You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by kseelam <kr...@hotmail.com> on 2010/09/16 00:40:32 UTC

Re: Method setMessagePrioritySupported(true) called on ActiveMQConnectionFactory doesn't work

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?


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.
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/Method-setMessagePrioritySupported-true-called-on-ActiveMQConnectionFactory-doesn-t-work-tp2354349p2541332.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Method setMessagePrioritySupported(true) called on ActiveMQConnectionFactory doesn't work

Posted by Timothy Bish <ta...@gmail.com>.
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/