activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: Method setMessagePrioritySupported(true) called on ActiveMQConnectionFactory doesn't work
Date Wed, 15 Sep 2010 22:55:24 GMT
On Wed, 2010-09-15 at 15:40 -0700, kseelam wrote:
> Hi Gary
> 
> We configure the prioritizedMessages and the messages are retrieving fine
> based on priority. 
> But while producing we had to set the priority to Producer to make it work
> like in the source of the priority test.
> 
> producer.setPriority(priority); 
> 
> But it does not work if we set the priority to the message only like below.
> 
> message.setJMSPriority( 7 );
> 
> Is there any reason why can't we set the periority to message?
> 

The JMS API doesn't allow you to set the priority on a Message instance,
it must be set in the MessageProducer's send call or the MessageProducer
must be configured to send at the desired priority as you did with the
call to 'setPriority' above.

>From the JMS API docs for Message.setJMSPriority:

"JMS providers set this field when a message is sent. This method can be
used to change the value for a message that has been received."

Regards

> 
> Gary Tully wrote:
> > 
> > 
> > priority support needs to be enabled for a destination with a policy
> > entry, prioritizedMessages
> > see: http://activemq.apache.org/per-destination-policies.html
> > The new (5.4) attributes are in red.
> > 
> > To see the programatic setup check out the source of the one of the
> > priority tests:
> > http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/MessagePriorityTest.java?view=markup
> > 
> > ....
> > 
> > 
> 
> 
> Thank you.

-- 
Tim Bish

Open Source Integration: http://fusesource.com

Follow me on Twitter: http://twitter.com/tabish121
My Blog: http://timbish.blogspot.com/


Mime
View raw message