How to prevent Spring Boot daemon/server application from closing/shutting down immediately?
- 阅读更多 关于 How to prevent Spring Boot daemon/server application from closing/shutting down immediately?
问题 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) after started. How do I prevent this? I'd like the app to stop if Ctrl+C or programmatically. @CompileStatic @Configuration class CamelConfig { @Bean CamelContextFactoryBean camelContext() { final camelContextFactory = new CamelContextFactoryBean() camelContextFactory.id = 'camelContext' camelContextFactory } } 回答1: As of Apache