Apache Camel:如何在文件uri组件中读取整数属性

时间:2017-10-16 09:25:29

标签: apache-camel jbossfuse

我正在尝试读取属性的整数值,但我收到错误。 我读过"在XML DSL中使用属性占位符来表示任何属性"在链接http://camel.apache.org/properties.html中。但我不理解文件uri组件中它的用法。

<from id="listenIncomingFiles" uri="file:{{PFlowIn_AEROW}}?include=.*\.xml&amp;prop:delay={{PFlowScanDelay}}&amp;noop=false&amp;preMove={{PMessDir}}"/>

Failed to create route .... because of Failed to resolve endpoint: file://D:/data/AeroW/OUT?include=.*\.xml&noop=false&preMove=D%3A%2Fdata%2FMessageDir&prop%3Adelay=2000 due to: Failed to resolve endpoint: file://D:/data/AeroW/OUT?include=.*\.xml&noop=false&preMove=D%3A%2Fdata%2FMessageDir&prop%3Adelay=2000 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{prop:delay=2000}]

请指导。

1 个答案:

答案 0 :(得分:1)

你能试试吗

<from id="listenIncomingFiles" uri="file:{{PFlowIn_AEROW}}?include=.*\.xml&amp;delay={{PFlowScanDelay}}&amp;noop=false&amp;preMove={{PMessDir}}"/>

而不是

<from id="listenIncomingFiles" uri="file:{{PFlowIn_AEROW}}?include=.*\.xml&amp;prop:delay={{PFlowScanDelay}}&amp;noop=false&amp;preMove={{PMessDir}}"/>

即&#34; prop:delay = {{PFlowScanDelay}}&#34;应替换为&#34; delay = {{PFlowScanDelay}}&#34;。不需要&#34;道具:&#34;设置消费者属性时的前缀。