Search code examples
messagepriority-queue

Is there any Message Queue supporting message based on priority?


I have a requirement where consumer needs to consume the high priority message first from a queue.

Can anyone worked on such open source queue?

Also it will be good if it support batch fetching of message?


Solution

  • i have implemented ActiveMQ and it support message priority for consumer on queue.So it should fulfil your requirement.check:

    http://activemq.apache.org/how-can-i-support-priority-queues.html

    http://www.christianposta.com/blog/?p=289

    As far batch message fetching is concerned,JMS don’t have any such method to fetch batch message from queue,you have to use multi-threading approach to run different consumer ,retrieved the message and group it on your side before delivering it to client.Or Loop the message throug hone consumer. For multi-threaded consumer make sure to use pref-etch policy =0 for consumer during connection or on the queue.