Reputation: 177
If I publish with confirmation(model.ConfirmSelect) AKA basic.ack and mandatory flag. Will I always get the basic.return event before the basic.ack event if the message was not delivered.
I want to add all basic.return messages to ConcurrentDictionary and after publish I'll check if the message is in the dicitonary I'll throw an exception, that no queue/route exists, and remove it, on error or success.
Upvotes: 2
Views: 2751
Reputation: 27367
Yes, you will always receive the events in that order.
From the documentation:
When will messages be confirmed?
For unroutable messages, the broker will issue a confirm once the exchange verifies a message won't route to any queue (returns an empty list of queues). If the message is also published as mandatory, the basic.return is sent to the client before basic.ack. The same is true for negative acknowledgements (basic.nack).
Upvotes: 2