Spring Boot 3.3升级后RabbitMQ重试消息发送延迟问题求助
Spring Boot 3.3升级后Spring Integration重试消息发送耗时剧增
环境与业务逻辑
- 项目基于Spring Integration,正从Spring Boot 2.7升级至3.3,核心依赖包括
spring-boot-starter-amqp、spring-integration-amqp、spring-boot-starter-integration - 采用单消费者模式,通过
SimpleMessageListenerContainer的**自动确认(AUTO)**机制消费migration.q队列消息,消息处理过程中调用各类外部接口 - 异常重试流程:消费发生异常时,消息进入错误通道,递增重试计数后发送至重试交换器
migration.rxo,该交换器会将消息重新投递回migration.q队列进行处理
异常现象
- 其他生产者向
migration.rxo发送消息的速度可达微秒级,性能正常 - Spring Boot 2.7环境下,本应用发送重试消息的耗时为5-6秒
- 升级至Spring Boot 3.3后,相同重试消息的发送耗时骤增至约35秒
RabbitMQ配置详情
{ "users": [ { "name": "admin", "password_hash": "xyz", "hashing_algorithm": "pqr", "tags": "administrator" }, { "name": "user", "password_hash": "abc", "hashing_algorithm": "mno", "tags": "" } ], "vhosts": [ { "name": "/" } ], "permissions": [ { "user": "user", "vhost": "/", "configure": "", "write": ".*", "read": ".*" }, { "user": "admin", "vhost": "/", "configure": ".*", "write": ".*", "read": ".*" } ], "exchanges": [ { "name": "migration.rxi", "vhost": "/", "type": "direct", "durable": false, "auto_delete": false, "internal": false, "arguments": {} }, { "name": "migration.rxo", "vhost": "/", "type": "direct", "durable": false, "auto_delete": false, "internal": false, "arguments": {} }, { "name": "migration.dlx", "vhost": "/", "type": "direct", "durable": false, "auto_delete": false, "internal": false, "arguments": {} }, { "name": "migration.large.rxi", "vhost": "/", "type": "direct", "durable": false, "auto_delete": false, "internal": false, "arguments": {} }, { "name": "migration.large.rxo", "vhost": "/", "type": "direct", "durable": false, "auto_delete": false, "internal": false, "arguments": {} }, { "name": "migration.large.dlx", "vhost": "/", "type": "direct", "durable": false, "auto_delete": false, "internal": false, "arguments": {} } ], "queues": [ { "name": "migration.q", "vhost": "/", "durable": false, "auto_delete": false, "arguments": { "x-dead-letter-exchange": "migration.dlx", "x-max-length": 10000 } }, { "name": "migration.wq", "vhost": "/", "durable": false, "auto_delete": false, "arguments": { "x-dead-letter-exchange": "migration.rxo", "x-message-ttl": 15000 } }, { "name": "migration.dlq", "vhost": "/", "durable": false, "auto_delete": false, "arguments": {} }, { "name": "migration.large.q", "vhost": "/", "durable": false, "auto_delete": false, "arguments": { "x-dead-letter-exchange": "migration.large.dlx", "x-max-length": 100000 } }, { "name": "migration.large.wq", "vhost": "/", "durable": false, "auto_delete": false, "arguments": { "x-dead-letter-exchange": "migration.large.rxo", "x-message-ttl": 15000 } }, { "name": "migration.large.dlq", "vhost": "/", "durable": false, "auto_delete": false, "arguments": {} } ], "bindings": [ { "source": "migration.rxi", "vhost": "/", "destination": "migration.wq", "destination_type": "queue", "routing_key": "", "arguments": {} }, { "source": "migration.rxo", "vhost": "/", "destination": "migration.q", "destination_type": "queue", "routing_key": "", "arguments": {} }, { "source": "migration.dlx", "vhost": "/", "destination": "migration.dlq", "destination_type": "queue", "routing_key": "", "arguments": {} }, { "source": "migration.large.rxi", "vhost": "/", "destination": "migration.large.wq", "destination_type": "queue", "routing_key": "", "arguments": {} }, { "source": "migration.large.rxo", "vhost": "/", "destination": "migration.large.q", "destination_type": "queue", "routing_key": "", "arguments": {} }, { "source": "migration.large.dlx", "vhost": "/", "destination": "migration.large.dlq", "destination_type": "queue", "routing_key": "", "arguments": {} } ] }
内容的提问来源于stack exchange,提问作者Harshit Bansal
相关产品推荐
相关产品推荐

