JMS message priority not working on Message

Viewed 12354

I need to set message priority so that High priority messages are consumed before Low priority messages by Receivers.

First I tried with message.setJMSPriority() method to set the priority but it was not working in HornetQ and ActiveMQ so finally I set the priority of the Message Producer using setPriority() method and it works fine now.

Why isn't Messsge.setJMSPriority() working in any of the JMS vendor implementations and why do we need to set the priority of the Producer not the message itself to set the priority of the message? What is the use of Messsge.setJMSPriority() method then?

Any suggestion or comment is appreciated.

4 Answers
Related