Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is message priority inherently unimportant in message queue systems?

It seems like most of the messaging systems I've looked at have basic, if any, support for priority message queues. For example, the AMQP only specifies a minimum of 2 priorities. RabbitMQ, an AMQP implementation, doesn't support any priorities. ActiveMQ will be getting support for 10 message priorities in version 5.4 in a couple days. 10 priority levels is the specified by the JMS spec.

A priority queue in the non-messaging sense of the word orders its contents based on an arbitrary field with an unconstrained range of priorities. Why does an implementation like this not exist as part of a messaging system? As I asked in the title, is priority an inherently non-messaging concept?

I realize that one answer might be that the concept of priority introduces the possibility of messages infinitely languishing in the queue while higher priority messages are processed. Are there other reasons?

like image 379
Edward Dale Avatar asked Aug 12 '10 07:08

Edward Dale


People also ask

Does RabbitMQ have any message priority justify your answer?

Yes, RabbitMQ supports priority queues. To make a queue work as a priority queue, supply property x-max-priority when declaring the queue. Property x-max-priority defines the maximum priority number the queue supports.

What is message priority in MQ?

You set the priority of a message (in the Priority field of the MQMD structure) when you put the message on a queue. You can set a numeric value for the priority, or you can let the message take the default priority of the queue.

How do I prioritize messages in queue?

When a message is queued, it is placed after the messages of the same priority already in the queue (in other words, FIFO within their order of queueing). This affects the flow-control parameters associated with the band of the same priority. Message priorities range from 0 (normal) to 255 (highest).

What is a message priority?

A category of precedence reserved for messages that require expeditious action by the addressee(s) and/or furnish essential information for the conduct of operations in progress when routine precedence will not suffice.


1 Answers

BTW ActiveMQ now supports priority messaging in 5.4.x via JMSPriority headers.

Rather than getting the message broker to re-order messages within some buffer as they arrive, there are often better techniques to implement priority consumption, such as having a dedicated consumer pool for high priority messages. Then irrespective of how much noise there is from low priority messages, high priority messages will always get though.

Given the asynchronous nature of messaging its easy to fill up buffers, network pipes and prefetch queues with low priority messages if using things like JMSPriority headers etc.

like image 64
James Strachan Avatar answered Sep 27 '22 18:09

James Strachan