Camel Spring 使用外部调度程序启动
Camel Spring Boot with External Scheduler
我们需要在 Camel Spring Boot 中使用第三方调度程序。我们可以构建 Spring Boot Jar 并将命令提供给外部调度程序以调用:
java -jar app-name.jar
问题是,一旦处理完成,我们将永远不知道何时 return 将控制权交还给外部调度程序(它不应该在两者之间停止,但只要完成就应该保持活动状态处理完成)。
在 Camel Spring 引导中,我们使用以下 属性 来保持路由线程处于活动状态:
camel.springboot.main-run-controller=true
如果我们将上面的 属性 设置为 false,Camel 甚至会在处理完成之前关闭。如果为真,Camel 将无限期保持活动状态,一旦完成,调度程序将无法关闭 Camel 进程。
感谢任何帮助。
我认为您正在寻找的是在处理一条消息后关闭您的 spring 启动应用程序。试试这个
camel.springboot.main-run-controller=true
camel.springboot.duration-max-messages=1
或者
camel.springboot.main-run-controller=true
camel.springboot.duration-max-idle-seconds=30
我们需要在 Camel Spring Boot 中使用第三方调度程序。我们可以构建 Spring Boot Jar 并将命令提供给外部调度程序以调用:
java -jar app-name.jar
问题是,一旦处理完成,我们将永远不知道何时 return 将控制权交还给外部调度程序(它不应该在两者之间停止,但只要完成就应该保持活动状态处理完成)。
在 Camel Spring 引导中,我们使用以下 属性 来保持路由线程处于活动状态:
camel.springboot.main-run-controller=true
如果我们将上面的 属性 设置为 false,Camel 甚至会在处理完成之前关闭。如果为真,Camel 将无限期保持活动状态,一旦完成,调度程序将无法关闭 Camel 进程。
感谢任何帮助。
我认为您正在寻找的是在处理一条消息后关闭您的 spring 启动应用程序。试试这个
camel.springboot.main-run-controller=true
camel.springboot.duration-max-messages=1
或者
camel.springboot.main-run-controller=true
camel.springboot.duration-max-idle-seconds=30