0

Im developping non OSGI app and i need to update the values ​​of some properties used in camel routes (loaded BridgePropertyPlaceHolder). So I thought:

  • To use Hawtio, the cool mangement console, in order update camel using JMX

  • Create a JMX MBean that will update the properties ..

I successfully create the MBean operations and call them using JMX, but I can't figure out how to update the camel routes that depends on these properties.

Is there a way to update the camel context externally?

Update: Exemple of use case:when a remote server doesn't return response, we keep sending messages until we reach the max of unsuccessful attempt(messages without ack). in camel we create a router pattern based on property loaded from file system. This property can change occasionally, and we want to do this without restarting server, but the problem is that camel parse routes when starting context and i can't find no mean to update routes accordingly.


I am grateful for any proposal that could help:)

4

3 回答 3

0

更改from端点参数(例如 URL 等),必须根据动态更改端点骆驼使用以下程序:

  1. 停止路线
  2. 删除路线
  3. 更改端点
  4. 添加路线
  5. 开始路线

如果to端点必须是可配置的,您可以使用收件人列表组件。在这里,您可以使用适当的 Camel 组件从数据库和/或文件系统中读取属性。

于 2014-05-18T06:31:14.700 回答
0

对于您希望它们动态的属性。您可以将这些道具移动到某个数据库并在您阅读时获取它们。我认为您的骆驼路线需要重新设计。

于 2014-05-17T20:26:28.133 回答
0

如果您使用 Camel 错误处理来重试(重新交付),那么您可以使用retryWhile继续重试直到您返回false。这允许您使用 java 代码等,并允许您阅读更新的配置选项。

查看更多详情

如果您有 Camel in Action 一书,请参阅第 152 页

于 2014-07-12T07:31:29.473 回答