1
我的要求看似简单明了。我需要轮询一个目录,并基于我需要的输入文件的文件名;骆驼路线 - 过滤文件名并设置标题值
a)设置一个标头值 b)指示消息到特定的JMS队列
我已经尝试了几种不同的方法来达致这而是基于文档的followng应该工作。显然对我来说它不...
<from uri="file:[some input directory]"/>
<when>
<simple>${file:name} contains 'new'</simple>
<setHeader headerName="messageType">
<constant>NEW</constant>
</setHeader>
<to uri="jmsbroker:queue:[queue for new items]"/>
</when>
<when>
<simple>${file:name} contains 'amend'</simple>
<setHeader headerName="messageType">
<constant>AMEND</constant>
</setHeader>
<to uri="jmsbroker:queue:[queue for amended items]"/>
</when>
<when>
<simple>${file:name} contains 'other'</simple>
<setHeader headerName="messageType">
<constant>OTHER</constant>
</setHeader>
<to uri="jmsbroker:queue:[queue for other]"/>
</when>
<otherwise>
<bean ref="deadLetterErrorHandler"/>
</otherwise>
</route>
任何帮助非常赞赏。
问候, 安迪