RabbitMQ guarantees the order of messages in the queue: First In, First Out. The first message to enter the queue will be the first message to exit the queue, and they will remain in order (assuming you just consume and toss them ... if you start a nacking / rejecting message, republishing them, etc., things change)
This is the only guarantee he will make in message order: FIFO queues.
If you need to guarantee an order that messages are delivered to the queue, you must create this process yourself.
FWIW, It is very difficult to build this guarantee. The only really guaranteed way to ensure message order is to not send the next one until the first one is processed.
Even if you are waiting for publisher confirmation before sending the next one, it is possible that the next one will be in line in the queue before the first one (although this is unlikely).
You can see Message Sequence and Resequencer if you need to ensure that the client receives messages in a specific order.
source share