如何在 Apache Camel Spring Boot 中保持监督路由控制器运行

问题描述 投票:0回答:1

我尝试使用监督路由控制器(如Camel文档中所述)在启动失败时重试启动路由。

我的

application.properties
文件中有以下几行:

camel.springboot.route-controller-supervise-enabled=true
camel.springboot.route-controller-initial-delay=5000
camel.springboot.route-controller-back-off-delay=5000
camel.springboot.route-controller-back-off-max-attempts=10
camel.springboot.main-run-controller=true

启动应用程序后,所有路线都会立即启动和停止,就好像选项

camel.springboot.main-run-controller=true
不存在一样。

...
2023-07-13T08:54:49.470+02:00  INFO 25984 --- [  restartedMain] c.b.c.l.LdapIntegrationApplication       : Started LdapIntegrationApplication in 13.596 seconds (process running for 17.256)
2023-07-13T08:54:49.507+02:00  WARN 25984 --- [ionShutdownHook] o.a.c.s.boot.SpringBootCamelContext      : CamelContext has only been running for less than a second. If you intend to run Camel for a longer time then you can set the property camel.springboot.main-run-controller=true in application.properties or add spring-boot-starter-web JAR to the classpath.
2023-07-13T08:54:49.509+02:00  INFO 25984 --- [ionShutdownHook] o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 4.0.0-M3 (LdapCamel) is shutting down (timeout:45s)
2023-07-13T08:54:49.524+02:00  INFO 25984 --- [ionShutdownHook] o.a.c.impl.engine.AbstractCamelContext   : Routes stopped (stopped:4)
...

如何保持监督路线控制器运行?

java spring-boot apache-camel
1个回答
0
投票

较新版本的 Camel 使用

camel.routecontroller.enabled=true

© www.soinside.com 2019 - 2024. All rights reserved.