【发布时间】:2015-11-15 08:55:08
【问题描述】:
在这种情况下,由于客户端处理不当,消息拒绝将自己传递给消费者,因此该消息在服务器和客户端之间无限反弹,导致连续的日志消息流填满磁盘空间.
如何避免这种情况?或者换句话说,如何将重试限制在有限的次数内?
我尝试使用 rabbit 模板重试模板,但没有成功。请在下面找到配置:
<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>
我参考了这篇文章来解决我的问题: Handling AMQP messages gracefully with spring-amqp
【问题讨论】:
标签: java spring rabbitmq amqp spring-amqp