spring-boot - 在 spring cloud 配置更新时重新加载 CamelContex

我正在使用带有 spring boot 2.2.6 的 camel 3.1.0。我有外部化配置,spring cloud bus 被用来从 Git 读取配置数据。

当我启动应用程序时,它通过 spring 云总线从 git 获取配置(属性),但是当我在 git 上更新配置并调用 actuator/bus-refresh 端点时,在 spring 中 camel 路由没有选择更改启动应用程序,尽管我在日志中看到该应用程序收到了属性的更新值。

我需要添加什么作为属性来让 Spring 引导在 spring 云总线事件上刷新 camel 上下文吗?

最佳答案

Camel 似乎不支持 Spring Cloud Config 提供的配置重新加载,并且没有计划添加它,如下所示:https://issues.apache.org/jira/browse/CAMEL-13892

配置更新时,Spring Cloud 会发送一个 RefreshScopeRefreshedEvent 事件。您可以添加一些自定义逻辑来监听该事件并显式地重新加载 Camel 组件。

关于spring-boot - 在 spring cloud 配置更新时重新加载 CamelContext 或路由,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60906000/

相关文章:

scala - 在同一规范文件中测试 akka-http 和 akka actor 时,如何解决冲突

javascript - typescript 装饰器 : Add instance field t

javascript - 为什么ioredis客户端开启keep-alive会超时?

qt - 如何在使用 AUTORCC 的 CMake 项目中使用 qtquick_compiler_

reactjs - 尝试使用 React-Spring 制作动画时出现错误 "TypeError:

python - 在 OR 工具中使用 IntVar

react-native - 我可以通过 expo 获得在 android 上工作的 webpack

scala - 在 Akka Streams 中模拟源

python - np.array 到 PIL 图像 --> Typerror : Cannot h

nginx - 为什么我在nginx中无法正常显示CJK字符?