使用配置 属性 设置 pollenrich 超时
Setting timeout for pollenrich using configuration property
我在我的代码中使用 pollenrich 从队列中获取消息:
<pollEnrich uri="activemq:queueName" timeout="5000"/>
现在,我想从 etc 文件夹中声明的配置文件中读取超时值。
像这样:
<pollEnrich uri="file:inbox?fileName=data.txt" timeout="{{readTimeout}}"/>
这样做时,出现以下错误:
org.xml.sax.SAXParseException : cvc-datatype-valid.1.2.1: '{{readTimeout}}' 不是 'integer'
的有效值
此错误仅出现在 pollenrich 上,我的代码中没有其他地方出现。我可以在同一个 camel-context 中使用配置文件中的其他属性。
例如,
<from uri="timer://TestTimer?period={{timer.interval}}&delay={{startupDelay}}/>
请参阅文档:http://camel.apache.org/using-propertyplaceholder.html 在标题为 对 XML DSL 中任何类型的属性使用 属性 占位符的部分=11=]
我在我的代码中使用 pollenrich 从队列中获取消息:
<pollEnrich uri="activemq:queueName" timeout="5000"/>
现在,我想从 etc 文件夹中声明的配置文件中读取超时值。 像这样:
<pollEnrich uri="file:inbox?fileName=data.txt" timeout="{{readTimeout}}"/>
这样做时,出现以下错误:
org.xml.sax.SAXParseException : cvc-datatype-valid.1.2.1: '{{readTimeout}}' 不是 'integer'
的有效值此错误仅出现在 pollenrich 上,我的代码中没有其他地方出现。我可以在同一个 camel-context 中使用配置文件中的其他属性。 例如,
<from uri="timer://TestTimer?period={{timer.interval}}&delay={{startupDelay}}/>
请参阅文档:http://camel.apache.org/using-propertyplaceholder.html 在标题为 对 XML DSL 中任何类型的属性使用 属性 占位符的部分=11=]