MQ重试
This commit is contained in:
@@ -28,20 +28,13 @@ spring:
|
||||
# 关键优化:解决MissedHeartbeatException 心跳超时问题
|
||||
connection-timeout: 10000 # 连接超时时间(10秒,避免连接建立过慢)
|
||||
requested-heartbeat: 30 # 心跳间隔调整为30秒(原60秒过长,降低超时概率;过短易误触发)
|
||||
# 高级配置:连接池 & 自动重连(核心优化,避免连接断开后无法恢复)
|
||||
cache:
|
||||
connection:
|
||||
mode: channel # 连接池模式(默认channel,推荐)
|
||||
size: 10 # 最大连接数,根据业务调整
|
||||
channel:
|
||||
size: 50 # 每个连接的最大通道数
|
||||
# 自动重连配置(Spring AMQP 自带,关键兜底)
|
||||
publisher-returns: true
|
||||
template:
|
||||
retry:
|
||||
enabled: true # 开启消息发送重试
|
||||
max-attempts: 3 # 最大重试次数
|
||||
initial-interval: 2000 # 首次重试间隔2秒
|
||||
initial-interval: 3000 # 首次重试间隔2秒
|
||||
multiplier: 1.5 # 重试间隔倍增因子
|
||||
listener:
|
||||
simple:
|
||||
|
||||
Reference in New Issue
Block a user