I'm trying to configure retry capability in my Spring Integration project where I'm trying to connect to Rabbit servers following the details provided here in this article section 3.3.1. But looks like the retry policy isnt kicking in. This is what I have in my configuration:
<!-- Spring AMQP Template -->
<rabbit:template id="amqpTemplate" connection-factory="connectionFactory" retry-template="retryTemplate"
exchange="myExchange" />
<bean id="retryTemplate" class="org.springframework.retry.support.RetryTemplate">
<property name="backOffPolicy">
<bean class="org.springframework.retry.backoff.ExponentialBackOffPolicy">
<property name="initialInterval" value="8" />
<property name="multiplier" value="100.0" />
<property name="maxInterval" value="100000" />
</bean>
</property>
<property name="retryPolicy">
<bean class="org.springframework.retry.policy.SimpleRetryPolicy">
<property name="maxAttempts" value="3"/>
</bean>
</property>
</bean>
<!-- Spring AMQP Admin -->
<rabbit:admin connection-factory="connectionFactory" />
Based on the snippet, I'm expecting the retry to happen 3 times at an exponential interval. But based on the logs I'm seeing the re-try attempt being made at 7 sec interval and it goes on forever (doesn't stop after 3 times).
Wondering if someone could point out what is wrong in my configuration.