jsr343-experts@jms-spec.java.net

[jsr343-experts] Re: (JMS_SPEC-34) Calling setJMSDeliveryMode or setJMSPriority on a javax.jms.Message before it is sent don't have any effect

From: Clebert Suconic <clebert.suconic_at_gmail.com>
Date: Mon, 25 Jul 2011 14:35:22 -0500

> JMS says that the consuming application can call getMessagePriority() or
> getDeliveryMode() on a message that it has just received. If the message
> implementation is from a foreign provider then the only way the JMS provider
> can set these is using setMessagePriority and setDeliveryMode.
>
Ok, I see.. (however it's for sending, not consuming).. when you
consume, you're deagling with your own consumer.


Most JMS IMplementations I know will have something like this on the
MessageProducer:


   public void send(final Destination destination, final Message
message) throws JMSException
   {
...
      message.setJMSDeliveryMode(defaultDeliveryMode);

      message.setJMSPriority(defaultPriority);

      doSend(message, defaultTimeToLive, (HornetQDestination)destination);
   }