【问题标题】:Reload CamelContext or routes on spring cloud config update在 Spring Cloud 配置更新中重新加载 CamelContext 或路由
【发布时间】:2020-07-09 08:56:48
【问题描述】:

我正在使用 Camel 3.1.0 和 Spring Boot 2.2.6。我有外部化配置,并且正在使用 Spring Cloud Bus 从 Git 读取配置数据。

当我启动应用程序时,它通过 spring cloud bus 从 git 获取配置(属性),但是当我在 git 上更新配置并调用执行器/总线刷新端点时,spring 中的骆驼路线没有选择更改启动应用程序,虽然我在日志中看到应用程序接收到属性的更新值。

我需要添加什么属性来让 Spring 启动在 Spring Cloud Bus 事件中刷新 Camel 上下文吗?

【问题讨论】:

    标签: spring-boot apache-camel spring-cloud-bus


    【解决方案1】:

    看来 Camel 不支持 Spring Cloud Config 提供的配置重载,也没有添加的计划,写在这里:https://issues.apache.org/jira/browse/CAMEL-13892

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

    【讨论】:

      猜你喜欢
      • 2017-02-08
      • 2019-01-18
      • 1970-01-01
      • 2018-10-26
      • 2019-05-29
      • 2016-06-05
      • 2020-10-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多