У меня есть автономное приложение springboot с настройкой Apache Camel 2.24 camelroutes. Ожидается, что приложение будет работать круглосуточно и без выходных. Сервисы, представленные как REST API через camel REST DSL.
**
Пожалуйста, помогите, как избежать завершения работы приложения camel springboot и не отключать процесс Java автоматически каждый день.
**
Я выполнил jar-файл springboot из Udeploy с помощью команды nohup java -jar для развертывания, чтобы избежать прерывания зависания.
Каждый день в определенное время дня приложение получает сообщение HangupInterceptor для завершения вызова и остановки основного экземпляра. Это изящно завершает мои маршруты Camel, закрывает контекст spring camel и, наконец, уничтожает сервлет camelhttptransport.
В конце концов, процесс jvm приложения springboot jvm также принудительно завершается / завершается контекстом Camel и больше не выполняется, когда я проверяю с помощью ps -ef | grep java
Журналы:
[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 включен
camel.springboot.main-run-controller=true
Файл pom.xml включен
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-started-web</artifactId>
</dependency>