Dead-Letter Exchanges
Dead-Letter Exchanges (https://www.rabbitmq.com/dlx.html) are used when the consumer cannot handle a particular message. It is typically used for answering questions such as:
I have a message in my queue that I do not know how to process successfully. I have tried processing it many times and I am sure I cannot handle it. What should I do?
I also have messages in my queue that are bad, as I don't know their syntax at all or they do not meet the business requirements. What should I do?
In Data Bus Implementation, we will define a Dead-Letter Exchange of the Direct Exchange type, to which all the messages that cannot be processed will be sent. We will do an explicit "reject" of the message and will NOT put it back in the queue.
The component rejecting the message will need to provide the following details:
- Correlation ID
- Message Payload
- Message Metadata
A dead-letter Exchange will have multiple queues bound to it based on the routing key.
A message will be considered dead when...