我正在尝试在我的 Spring Integration 项目中配置重试功能,我正在尝试按照本文第 3.3.1 节中提供的详细信息连接到 Rabbit 服务器。但看起来重试策略没有生效。这就是我的配置中的内容:
<!-- 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" />
根据该片段,我希望重试以指数间隔发生 3 次。但是根据日志,我看到重试尝试以 7 秒的间隔进行,并且它会永远持续下去(3 次后不会停止)。
想知道是否有人可以指出我的配置有什么问题。