2

I have a Configured Spring integration with RabbitMQ as message broker. I have a scenario where the application may be deployed in production with RabbitMQ down.When it happens the application continuosly tries to reconnect

org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer run
WARNING: Consumer raised exception, processing can restart if the connection factory supports it. Exception summary: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused

My server log get filled with these logs. How can I configure the connection factory, to say, try to reconnect only 5 times in interval of 10,30 or 60 mis ? I want to be able to control the retry and print some custom message.

Adelin
  • 18,144
  • 26
  • 115
  • 175

1 Answers1

3

There is only a simple recoveryInterval, which you can increase, but it is fixed; this answer has some suggestions about how to implement something more sophisticated.

Community
  • 1
  • 1
Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • Spring AMQP version 1.5 (currently at 1.5.0.M1 milestone) [now supports injecting a BackOff implementation (including exponential)](http://docs.spring.io/spring-amqp/docs/1.5.0.BUILD-SNAPSHOT/reference/html/_introduction.html#_simplemessagelistenercontainer_backoff_support). – Gary Russell May 18 '15 at 12:28