Reputation: 6263
So Apache camel has this graceful shutdown feature that waits 300 seconds, and it's really annoying. I say this because I'm running local testing and I get errors where a request will hang, and I want to abort it by shutting my app down. But then I get stuck waiting for 5 mins for all inflight transactions to finish.
I want the ability to disable this graceful shutdown waiting period for my local testing so I can just kill the whole process and start over. Any advice would be appreciated.
Upvotes: 2
Views: 2528
Reputation: 38177
Here's the documentation of the spring boot property: https://camel.apache.org/camel-spring-boot/3.7.x/spring-boot.html
camel.springboot.shutdown-timeout | Timeout in seconds to graceful shutdown Camel. | 300 | Integer
Setting camel.springboot.shutdownTimeout = 1
in the application test properties was the easiest way to adjust this.
For the new Camel Spring Rabbit component, the above setting seems to not be heeded. You can implement a custom shutdown strategy, as documented in Spring Camel integration tests slow with Timeout message .
Upvotes: 0
Reputation: 4919
You can set shutdown timeout to some lower value. There are many options to set shutdown timeout value:
camel.springboot.shutdownTimeout = 1
ShutdownStrategy
property - getContext().getShutdownStrategy().setTimeout(1)
java -DCAMEL_MAIN_SHUTDOWNTIMEOUT=1 ...
setTimeout()
on MBean org.apache.camel:context=MyCamel,type=context,name="MyCamel"
For more details see Graceful shutdown. In Camel 3.1 and later will be default shutdown timeout reduced to 45s - CAMEL-14336.
Upvotes: 4