骆驼分裂的动态超时 [英] dynamic timeout for camel split

查看:21
本文介绍了骆驼分裂的动态超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用camel 2.13.2 并想为camel:split 设置可以从交换中读取的超时.

I am using camel 2.13.2 and want to set timeout for camel:split that can be read from exchange.

静态超时效果很好.

<camel:split timeout="500">

但不是以下.假设我已将 property.timeout 设置为交换属性

but not the following. assume I have set property.timeout as an exchange property

<camel:split timeout="{{property.timeout}}">

我在服务器启动过程中出现以下错误

I get following error during server startup

引起:org.xml.sax.SAXParseException;行号:75;列数:67;cvc-datatype-valid.1.2.1:{{property.timeout}}"不是整数"的有效值.

是否可以以动态方式设置拆分超时?

Is there anyway timeout for split can be set in dynamic way?

感谢您的帮助!

推荐答案

是的,您需要使用 Camel 网站中记录的 prop 前缀指定此项.请参阅在 XML DSL 中为任何类型的属性使用属性占位符部分:http://camel.apache.org/using-propertyplaceholder.html

Yes you need to specify this using the prop prefix which is documented in the Camel website. See the section Using Property Placeholders for Any Kind of Attribute in the XML DSL at: http://camel.apache.org/using-propertyplaceholder.html

这样就变成了

<camel:split prop:timeout="{{property.timeout}}">

并且你需要记住在XML文件的顶部添加prop作为命名空间,例如

And you need to remember to add prop in the top of the XML file as a namespace, eg

`xmlns:prop="http://camel.apache.org/schema/placeholder"`

但在该链接中查看更多详细信息.

But see more details in that link.

这篇关于骆驼分裂的动态超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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