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.
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