Search code examples
jakarta-eejmswebspheremessage-driven-bean

How can I prioritize messages on different queues?


A resource allocation/prioritizing problem.

I'm working on a Java EE application which has a number of Message Driven Beans (MDB) which receive messages from different JMS queues, let's say queue A/MDB A and queue B/MDB B for simplicity.

When there is high load the system needs to prioritize messages coming in on queue A over messages on queue B. Why? Messages on queue A need to be processed as quickly as possible and thus MDB A needs "all" db, cpu resources etc.

Do you have any advice on how to solve this in a clean way? Not so clean could work as well...

My production server is WebSphere Application Server 7, using SIBus for message delivery. WebSphere MQ could be an option.

Thanks for any suggestions!


Solution

  • After investigating this issue with people that are experts in the area I got some bad news:

    This probably can't be done.

    100% can't be done using SIB, You can only prioritize messages within a single destination.

    About WebSphere MQ, also seems that it can't be done, they only properties for queue priority is when dealing with a single queue in a cluster, which I guess doesn't help you.

    So, sadly, this probably can't be done, if you need to prioritize messages you might need to change your architecture a bit. Perhaps a single queue with a selector. Then you can prioritize messages of some type.