admin管理员组文章数量:1356413
I'm upgrading from Spring Boot 2.7 to Spring Boot 3.3
- Publisher(another app) publishes to exchange
migration.rxi
to queuemigration.wq
to exchangemigration.rxo
to queuemigration.q
Mine is spring integration app with libraries :
spring-boot-starter-amqp
,
spring-integration-amqp
spring-boot-starter-integration
The application is currently on single consumer.
Using SimpleMessageListenerContainer : AUTO Acknowledgement Mode
- Consumes message from queue
migration.q
- Calls various endpoints
- If an exception occurs, goes to error Channel
- In error channel retry count is incremented and message is put on retry exchange
migration.rxo
which delivers it to main queuemigration.q
for re-processing.
When publisher sends to exchange migration.rxo
it is quick(microseconds)
When My App sends to exchange (for retry)migration.rxo
it takes 5-6 seconds in Spring Boot 2. It is now taking around 35 seconds delay in Spring Boot 3.
My rabbit mq configuration is here :
{
"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": {}
}
]
}
I'm upgrading from Spring Boot 2.7 to Spring Boot 3.3
- Publisher(another app) publishes to exchange
migration.rxi
to queuemigration.wq
to exchangemigration.rxo
to queuemigration.q
Mine is spring integration app with libraries :
spring-boot-starter-amqp
,
spring-integration-amqp
spring-boot-starter-integration
The application is currently on single consumer.
Using SimpleMessageListenerContainer : AUTO Acknowledgement Mode
- Consumes message from queue
migration.q
- Calls various endpoints
- If an exception occurs, goes to error Channel
- In error channel retry count is incremented and message is put on retry exchange
migration.rxo
which delivers it to main queuemigration.q
for re-processing.
When publisher sends to exchange migration.rxo
it is quick(microseconds)
When My App sends to exchange (for retry)migration.rxo
it takes 5-6 seconds in Spring Boot 2. It is now taking around 35 seconds delay in Spring Boot 3.
My rabbit mq configuration is here :
{
"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": {}
}
]
}
Share
Improve this question
edited Mar 28 at 11:16
Harshit Bansal
asked Mar 27 at 22:22
Harshit BansalHarshit Bansal
711 silver badge9 bronze badges
6
|
Show 1 more comment
1 Answer
Reset to default 0I found out, for gateways the default timeout has changed from 1000ms to 30000ms.
Other then that, the solution that worked for me is changing from outbound gateway to outbound adapters.
Gateway is about request-response
and waits for response whereas adapters is just about send.
As per my requirements, adapters work well. So, I moved from outbound gateway to outbound adapter.
本文标签: rabbitmqspring boot 3 upgrade causing delays in receiving message from rabbit mqStack Overflow
版权声明:本文标题:rabbitmq - spring boot 3 upgrade causing delays in receiving message from rabbit mq - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744065346a2584887.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
this.replyTimeout = 1000L; template.setSendTimeout(1000L); template.setReceiveTimeout(this.replyTimeout);
I see this has now changed to 30000 in spring-integration 6 – Harshit Bansal Commented Mar 31 at 11:25