Time To Live TTL is the abbreviation, that is, the survival time
RabbitMQ supports message expiration time, when the message is sent can be specified
RabbitMQ supports the expiration time of the queue, the message from the queue counted, as long as more than the timeout queue configuration, the message will automatically clear
DLX use, when the message becomes a dead letter (dead message) in a queue, it can be re-publish Exchange to another, this is DLX Exchange
DLX is a normal Exchange, the Exchange and the general is no different, it can be specified on any queue, the queue is actually a set of attributes for the Dead Letter Queue
When this has dead letter queue, the message will automatically RabbitMQ republish Exchange set up, and then be routed to another queue
Can listen to the messages in the queue to do the appropriate treatment, this feature can make immediate parameter of function previously supported RabbitMQ3.0
Message into several cases the dead letter queue
Message is rejected (basic.reject / basic.nack) and return queue arranged false requeue
TTL expired messages
The maximum length of the queue
Configuring the dead-letter queue
You must first set the exchange dead letter queue and queue, then bind (switch name and the name of the dead letter queue queue can only write) 1.Exchange: dlx.exchange 2.Queue: dlx.queue 3.RoutingKey: #
Then normal switch statement, queue, binding, but need to add a queue can be extended parameters: arguments.put ( "x-dead-letter-exchange", "dlx.exchange");
Thus the expiration message, reject or nack (requeue be arranged to false), the maximum queue length is reached, the message can be routed directly to the dead letter queue