Here is a situation where in a message refuses to deliver itself to the consumer due to improper handling by the client and therefore this message bounces infinitely between the server and the client resulting into continuous stream of log messages which fills up the disk space.
How to avoid this situation? Or in other words how to restrict the retry to a limited number of times?
I tried retry template with rabbit template but with no success. Please find the configuration below:
<rabbit:template id="rabbitTemplate" connection-factory="connectionFactory" reply-timeout="10" retry-template="retryTemplate"/>
<bean id="retryTemplate" class="org.springframework.retry.support.RetryTemplate">
<property name="backOffPolicy">
<bean class="org.springframework.retry.backoff.ExponentialBackOffPolicy">
<property name="initialInterval" value="500" />
<property name="multiplier" value="10.0" />
<property name="maxInterval" value="10000" />
</bean>
</property>
</bean>
I referred this article for my problem: Handling AMQP messages gracefully with spring-amqp