I was literally going to send the same email when i started reading the thread. The way to set thigns like TTL, priority, deliveryMode is on the MessageProducer either via the setters or the send methods. The setters on the message are not for application use prior to sending and will be overriden by the producer configuration in use at the time of sending. I also find it unintuitive, but thats how its meant to work.
Robbie On 10 January 2012 13:24, Gordon Sim <[email protected]> wrote: > On 01/10/2012 12:31 PM, eugene wrote: >> >> messageProducer.send(message, DeliveryMode.NON_PERSISTENT, 1, 10000); >> >> OR >> >> message.setJMSExpiration(10000); > > > From section 3.4.11 of the JMS specification, 'How Message Header Values Are > Set', it looks like the 'correct' way in JMS is the first of these, i.e. the > send method. > > The text in > http://docs.oracle.com/javaee/1.4/api/javax/jms/Message.html#setJMSExpiration%28long%29 > also states 'JMS providers set this field when a message is sent', which > isn't as explicit as it might be. > > I find this (and the similar situation with delivery mode etc) to be > unintuitive, but that is how it is specified. I'm not sure what exactly the > Qpid JMS client does with the expiration specified on a message before a > send() - can anyone else give an authoritative statement on that? > > > --------------------------------------------------------------------- > Apache Qpid - AMQP Messaging Implementation > Project: http://qpid.apache.org > Use/Interact: mailto:[email protected] > --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:[email protected]
