SpringBoot and Camel graceful shutdown

24 Views Asked by At

I have a Spring Boot app using the Camel framework, and I have configured server.shutdown: graceful in the YAML file to enable graceful shutdown. The shutdown process works as expected when there are no processing tasks in Camel routes. In this scenario, when the shutdown is initiated, the Spring Boot controller stops accepting new requests, responds with a 503 status (I'm using Undertow as the web container), and waits for the default Camel shutdown time (45 seconds) before forcing a shutdown.

However, the issue arises when there are active processing tasks in Camel. In this situation, even during the shutdown process, the controller is still able to accept new requests. This behavior is not what I'm expecting.

Can anyone help me understand why is this happening? And how could i fix it ?

Graceful shutdown in SpringBoot application with camel.

0

There are 0 best solutions below