spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://192.168.1.43:3306/czg_cashier?useUnicode=true&characterEncoding=utf-8 username: root password: Chaozg123. data: redis: host: 192.168.1.43 port: 6379 password: Chaozg123. timeout: 1000 database: 0 cloud: nacos: discovery: server-addr: 121.40.109.122:8848 namespace: 237e1905-0a66-4375-9bb6-a51c3c034aca rabbitmq: host: 121.40.109.122 port: 5672 username: chaozg password: chaozg123 # 关键优化:解决MissedHeartbeatException 心跳超时问题 connection-timeout: 10000 # 连接超时时间(10秒,避免连接建立过慢) requested-heartbeat: 30 # 心跳间隔调整为30秒(原60秒过长,降低超时概率;过短易误触发) # 自动重连配置(Spring AMQP 自带,关键兜底) publisher-returns: true template: retry: enabled: true # 开启消息发送重试 max-attempts: 3 # 最大重试次数 initial-interval: 3000 # 首次重试间隔2秒 multiplier: 1.5 # 重试间隔倍增因子 listener: simple: retry: enabled: true # 开启消费者重试 max-attempts: 3 # 消费者最大重试次数 acknowledge-mode: auto # 确认模式(可根据业务改为manual) dubbo: application: name: order-server qos-port: 22231 qos-enable: true registry: address: nacos://121.40.109.122:8848 # Nacos 服务地址 group: server-dev protocol: port: 10201 threads: 20 name: dubbo serialization: hessian2 seata: application-id: order-server tx-service-group: group_seata config: type: nacos nacos: server-addr: 121.40.109.122:8848 namespace: group: group_seata