I am referring to rabbitmq AMQP-0.9 documentation for basic_publish method. It refers two flags for the message :- 1) Immediate, 2) Mandatory.
mandatory
This flag tells the server how to react if the message cannot be routed to a queue. If this flag is set, the server will return an unroutable message with a Return method. If this flag is zero, the server silently drops the message.
The server SHOULD implement the mandatory flag.
For Immediate:-
immediate
This flag tells the server how to react if the message cannot be routed to a queue consumer immediately. If this flag is set, the server will return an undeliverable message with a Return method. If this flag is zero, the server will queue the message, but with no guarantee that it will ever be consumed.
The server SHOULD implement the immediate flag.
What's the difference between both flags, as both looks same ? Moreover, what is the difference between undelivered and unrouted message, from the perspective of rabbitmq server ?