Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [openmq-dev] Support of Message Order Process in Queue



On Thu, Jan 14, 2021 at 12:39 AM Gurkan Erdogdu <gerdogdu@xxxxxxxxxxxxx> wrote:
Hi folks
Does OpenMQ support to preserve order of messages in Queue which has multiple consumers? I.e, that the messages are consumed in the order they were added to the queue?
For example:
Queue Content : …. A|B|C

Then, first C will be processed by any consumer and when this is finished and ACKed, B will be processed and then A.

Not across multiple consumers, no. Honestly, nobody is going to guarantee that across multiple consumers. In that case, you may as well have a single consumer.

In your case you're asking the queue to be stalled until A is consumed...by anyone. With multiple consumers, that's just not going to happen. With a single consumer, then, yea, message order is retained FROM A SINGLE SESSION. But if one session is sending A B C and another D E F, there's no guarantee that a consumer won't see A D B E C F as a message stream.

If that style of message order is that important, you're better off batching them in a single message, having a single consumer, and/or spooling up multiple queues.

Regards,

Will Hartung



Back to the top