I have a stand-alone springboot application with Apache Camel 2.24 camelroutes setup. It is expected to run the application 24x7 and never go down. The services exposed as REST API through camel REST DSL.
**
Please help how to avoid the camel springboot application from shutting down and not shut down the java process automatically every day
**
I have executed the springboot jar from Udeploy with a nohup java -jar command to deploy to avoid hang ups interruption.
Every day at specific time of day the application receives a HangupInterceptor message for Hang up and stopping the main instance. This Shuts down my Camel routes gracefully, shuts down spring camel context and finally destroys the camelhttptransport servlet.
Eventually the springboot application’s jvm java process is also forcefully shutdown/terminated by the Camel context and no longer running when I check with ps -ef | grep java
Logs:
[ngupInterceptor] o.a.c.m.MainSupport$HangupInterceptor : Received hang up - stopping the main instance.
[ngupInterceptor] o.a.camel.spring.SpringCamelContext : Apache Camel 2.24.0 (CamelContext: Camel1) is shutting down
[ngupInterceptor] o.a.camel.impl.DefaultShutdownStrategy : Starting to graceful shutdown 2 routes(timeout 300 seconds)
[ - ShutdownTask] o.a.camel.impl.DefaultShutdownStrategy : Route: routename1 shutdown complete, was consuming from: direct://r1
[ - ShutdownTask] o.a.camel.impl.DefaultShutdownStrategy : Route: routename2 shutdown complete, was consuming from: direct://r2
[ngupInterceptor] o.a.camel.impl.DefaultShutdownStrategy : Graceful shutdown of 2 routes completed in 0 seconds
[ Thread-7] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService ’applicationTaskExecutor’
[ngupInterceptor] o.a.camel.main.MainLifecycleStrategy : CamelContext: Camel1 has been shutdown, triggering shutdown of the JVM
[ngupInterceptor] o.a.camel.spring.SpringCamelContext : Apache Camel 2.24.0 (CamelContext: Camel1) uptime 6 hours 10 minutes
[ngupInterceptor] o.a.camel.spring.SpringCamelContext : Apache Camel 2.24.0 (CamelContext: Camel1) is shutdown in 0.052 seconds
[ Thread-7] o.a.c.c.s.CamelHttpTransportServlet : Destroyed CamelHttpTransportServlet[Servlet]
application.properties file this is included
camel.springboot.main-run-controller=true
pom.xml file this is included
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-started-web</artifactId>
</dependency>