如何更新外部骆驼属性? [英] How to update camel properties externally?

查看:172
本文介绍了如何更新外部骆驼属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

林非的深化发展OSGI应用程序,我需要更新驼路(装BridgePropertyPlaceHolder)使用的一些属性值。
因此,我认为:

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


  • 要使用JMX使用Hawtio,清凉的管理CHINESE控制台,以更新的骆驼

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

创建一个JMX MBean的,将更新属性。

Create a JMX MBean that will update the properties ..

我成功创建的MBean操作,并使用JMX给他们打电话,但我无法弄清楚如何更新取决于这些属性骆驼路线。

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?

更新:
用例为例:当一个远程服务器不响应返回,我们继续,直到我们(无ACK消息)达到不成功的尝试的最大发送消息。
骆驼我们创建一个基于从文件系统加载特性的路由器模式。
此属性偶尔会发生变化,我们要做到这一点,无需重新启动服务器,但启动上下文时的问题是,骆驼解析路线,我找不到不意味着相应地更新路由信息。

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:)

推荐答案

如果您使用骆驼错误处理重试(重新提交),那么你可以使用 retryWhile 来继续重试直到返回。这使您可以用java code等,并且可以读取更新的配置选项。

If you use Camel error handling to retry (redeliver) then you can use the retryWhile to keep retrying until you return false. This allows you to use java code etc, and that allows you to read the updated configuration option.

查看更多详细信息,在

  • http://camel.apache.org/exception-clause.html

如果你有骆驼在行动书副本,请参阅第152页

And if you have a copy of Camel in Action book, see page 152

这篇关于如何更新外部骆驼属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆