简体   繁体   中英

Spring amqp dead letter exchange with multiple queue bind

In my app , using two queues which are binded with one exchange with a key a. . Any message coming with matching with this key regex will go to both the queues.

Case 2 : I am trying to implement delay message and max retries in case consumer's business exception using dead letter exchange mechanism.

Problem case suppose one of the queue's consumer's through business exception.... It will go the dlx and then to the main exception..... Then from the main exception.... Message is going to both the queues. This is the issue which I am facing ..... I want that retry message should go to that queue only from where the consumer exception occurred.

Now in my cases retry message is going to all the queues and creating duplicate messages.

You can add a second, queue-specific, binding for each queue; then configure each DLQ with that specific routing key...

x-dead-letter-exchange=mainExchange x-dead-letter-routing-key=retryMainQ1

Of course, you need 2 DLQs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM