RabbitMQ and message priority

前端 未结 7 1268
情书的邮戳
情书的邮戳 2020-12-13 17:53

Does RabbitMQ have any concept of message priority? I have an issue were some more important messages are being slowed down due to less important messages sitting before it

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-13 18:24

    IIRC RabbitMQ still uses the AMQP protocol version 0.9.1 (get the spec here). The spec definitely mentions message priority:

    Messages may have a priority level. A high priority message is sent ahead of lower     priority messages
    waiting in the same message queue. When messages must be discarded in order to maintain a specific
    service quality level the server will first discard low-priority messages.
    

    And:

    Note that in the presence of multiple readers from a queue, or client transactions, or use of priority fields,
    or use of message selectors, or implementation-specific delivery optimisations the queue MAY NOT
    exhibit true FIFO characteristics.
    

    The spec says priority is a MUST, so I guess RabbitMQ should implement it, but you may want to consult its documentation.

提交回复
热议问题