[jboss-user] [JBoss Messaging] - Re: Message priority does not seem to work

ydzsidemiik do-not-reply at jboss.com
Wed Feb 6 16:47:26 EST 2008


I have done as you suggested and written a pure JMS test case, which reproduces the same behavior.

http://www.mediafire.com/?ec6wfg9cg1b

It is a simple J2SE application, with a main() method. It connects to JBoss Messaging from outside the container.

During my testing, I was surprised to find that priorities set on JMS message objects (javax.jms.Message.setJMSPriority(int)) seem to be getting ignored. The "high priority" messages come out of the queue with their priority set to 4, which would explain why they are not being treated preferentially.

Priorities set on MessageProducers seem to have an effect though; the priority takes and the message reflects its higher priority (via javax.jms.Message.getJMSPriority()) when it comes out of the queue. Even here however, I noted delays of up to 10 seconds in this particular test in handling these high priority messages. It seems reasonable to expect that for a consumer capable of handling 15 messages per second, one high priority message every five seconds could be handled almost instantly, but I am not a messaging middleware expert and may be missing something fundamental. Please correct me if so.

If you run the example, run it first as is to see how priorities set on messages are ignored. Then, uncomment the lines marked with "XXX:" in Main.java to see how setting priorities on the MessageProducer level improves things.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127185#4127185

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127185



More information about the jboss-user mailing list