1
votes

I am using SimpleMessageListenerContainer for messaging and when a connection goes down my logs are filled with the below log messages:

INFO SimpleAsyncTaskExecutor-634 SimpleMessageListenerContainer$AsyncMessageProcessingConsumer:1154 - Restarting Consumer: tags=[[]], channel=null, acknowledgeMode=AUTO local queue size=0 2015-01-06 20:50:50.410 GMT WARN SimpleAsyncTaskExecutor-635 SimpleMessageListenerContainer$AsyncMessageProcessingConsumer:1163 - Consumer raised exception, processing can restart if the connection factory supports it org.springframework.amqp.AmqpIOException: java.net.NoRouteToHostException: No route to host

Is there any way to prevent logging of such message numerous times. Instead is there any setting to control how often to emit such logs?

1

1 Answers

1
votes

You can set the log level for category...

org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer

... in your logging configuration to WARN.

Or, increase the recoveryInterval (it's 5000 - 5 seconds - by default), but that will mean it will take longer to recover when the connection is lost.