How to prevent Spring Boot daemon/server application from closing/shutting down immediately?

前端 未结 9 748
不知归路
不知归路 2020-12-03 01:10

My Spring Boot application is not a web server, but it\'s a server using custom protocol (using Camel in this case).

But Spring Boot immediately stops (gracefully) a

9条回答
  •  天涯浪人
    2020-12-03 02:05

    Spring Boot leaves the task of running the application to the protocol around which the application is implemented. See, for example, this guide:

    Also required are some housekeeping objects like a CountDownLatch to keep the main thread alive...

    So the way of running a Camel service, for example, would to be to run Camel as a standalone application from your main Spring Boot application class.

提交回复
热议问题