我的Spring Boot应用程序不是Web服务器,但它是使用自定义协议的服务器(在本例中使用Camel).
但Spring Boot在启动后立即停止(优雅地).我该如何防止这种情况?
我希望应用程序在Ctrl + C或编程时停止.
@CompileStatic
@Configuration
class CamelConfig {
@Bean
CamelContextFactoryBean camelContext() {
final camelContextFactory = new CamelContextFactoryBean()
camelContextFactory.id = 'camelContext'
camelContextFactory
}
}
Run Code Online (Sandbox Code Playgroud)