spring-boot - 带有外部调度程序的 Camel Spring Boot
问题描述
我们需要在 Camel Spring Boot 中使用第三方调度器。我们可以构建 Spring Boot Jar 并将命令提供给外部调度程序以调用:
java -jar app-name.jar
问题是,一旦处理完成,我们将永远不知道何时将控制权返回给外部调度程序(它不应该在两者之间停止,但只要完成处理就应该保持活动状态)。
在 Camel Spring Boot 中,我们使用以下属性来保持路由线程处于活动状态:
camel.springboot.main-run-controller=true
如果我们将上述属性设为 false,Camel 甚至会在处理完成之前关闭。如果这是真的,Camel 将无限期地保持活动状态,并且一旦完成,调度程序将无法关闭 Camel 进程。
感谢您对此的任何帮助。
解决方案
我认为您正在寻找的是在处理完一条消息后关闭您的 Spring Boot 应用程序。尝试这个
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
推荐阅读
- entity-framework - Entity Framework 6 一对多附加导航属性
- python-3.x - 使用带有 by 参数的 pandas hist() 函数显示多个直方图时,如何显示 x 和 y 标签?
- python - Python 将制表符分隔的双语 txt 拆分为两个单独的 txt 文件(列表),用换行符分隔字符串
- c++ - CRTP - 静态接口中的“抽象”方法
- javascript - 类更改时的 CSS 过渡
- excel - VBA 中是否有可以允许密码保护的替代 SaveCopyAs 属性?
- docker - NOAUTH 需要身份验证。[tcp://redis:6379]。如何解决此问题在我的 docker 容器中为 redis 添加 'vm.overcommit_memory = 1'?
- javascript - 打字稿:类型检查正确的方法
- interface - 抽象如何实现接口?
- matlab - 如何在 Matlab 中对结构中的字段值进行排序?