Question about Spring AMQP, DLQ, and Error Handling #2938
-
Hi, I’m working on a personal project with two Spring Boot applications communicating asynchronously via RabbitMQ using Spring AMQP. I successfully set up communication and explored error handling based on this article: https://www.baeldung.com/spring-amqp-error-handling. After implementing the mechanism and testing, I noticed this behavior: When a fatal exception occurs (determined by overriding After debugging, I found that in Could someone clarify if this is the expected behavior? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The behavior is correct.
So, the default is exactly what you have observed: the message is sent to DLX, then it is comes back to the original queue, but it has now that You may treat this logic as a retry pattern. |
Beta Was this translation helpful? Give feedback.
The behavior is correct.
See
ConditionalRejectingErrorHandler
Javadocs and its logic:So, the default is exactly what you have observed: the message is sent to DLX, then it is comes back to the original queue, but it has now that
x-death
header.Therefore, when this message fails again,…