0
votes

I'm working with a Spring Boot 2.0.2 application and I want to configure RabbitMq to retry failed messages 3 times, with an interval between each retry.

Previously on Spring Boot 1.5.1 I have successfully setup this on application.properties:

spring.rabbitmq.listener.retry.enabled=true
spring.rabbitmq.listener.retry.initial-interval=45000
spring.rabbitmq.listener.retry.max-attempts=3
spring.rabbitmq.listener.retry.multiplier=1.3
spring.rabbitmq.listener.retry.max-interval=80000

I've tried do the same on Spring Boot 2.0.2 but it doesn't work. I've read that these properties have changed in Spring Boot 2.0, but even after updating the properties, it still doesn't work:

spring.rabbitmq.listener.direct.retry.enabled=true
spring.rabbitmq.listener.direct.retry.initial-interval=45000
spring.rabbitmq.listener.direct.retry.max-attempts=3
spring.rabbitmq.listener.direct.retry.multiplier=1.3
spring.rabbitmq.listener.direct.retry.max-interval=80000

Am I missing something?

1

1 Answers

2
votes

The default container type is simple.

Use spring.rabbitmq.listener.simple.retry.enabled=true unless you decide to use the direct container type instead.

See Choosing a Container.

The DMLC was added in Spring AMQP 2.0; the boot properties were deprecated in a later 1.5.x release, switching to the ...simple... properties in preparation for Boot 2.0.