views:

153

answers:

2

Hi,

Is there a way to prioritize the messages in the JMS broker according to a custom header value?

For Example: "purchase date". get oldest first etc.

Please advise.

+1  A: 

There is no way to do this within the boundaries of the JMS standard. It doesn't support custom routing rules like this.

However, many products that implement JMS support some kind of rules-based routing/prioritizing like this, so you should look into your products documentation.

Joachim Sauer
Thanks. Didn't find anything like this in ActiveMQ or HornetQ. Anyone know such a feature in any known JMS provider?
YaOg
A: 

You can probably use something like Apache Camel or ServiceMix to manipulate the JMSPriority header based on anything in the message. ActiveMQ comes with camel built in, I'd start there.

If we aren't talking about opensource solutions Tibco BusinessWorks (not a fan) should also work.

I don't think you will find this in a JMSProvider directly, this is more of an ESB/message router sort of thing.

Of course, before you actually send the message you can apply your business rules to the JMSPriority header before you send it. Note: I don't think ActiveMQ actually supports the JMSPriority header at this point.

Trey