0
votes

using Spring Boot 2.1.6 and Spring AMQP/RabbitMQ neither of these application.properties do trigger a DLX/DLQ when an Exception is thrown in the @RabbitListener:

spring.rabbitmq.listener.direct.default-requeue-rejected=false
spring.rabbitmq.listener.default-requeue-rejected=false

instead isDefaultRequeueRejected() always evaluates to true. how do I change that to false to cause a proper DLX/DLQ?

1

1 Answers

2
votes

Perhaps you are missing

spring.rabbitmq.listener.type=direct

?

I get the same result as you when that is missing - none of the listener properties are applied, including the one you are talking about.

spring.rabbitmq.listener.type=direct
spring.rabbitmq.listener.direct.default-requeue-rejected=false

works fine for me; failed messages are rejected without being requeued.

The default container type is simple so the direct property you set is ignored.