This commit is contained in:
2025-12-30 13:32:16 +08:00
parent befd2942a2
commit d854ff9e30

View File

@@ -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: