2
我试图从CXF端点检索SOAP消息,然后将其发送到基于内容的路由器,该路由器以XML文件的形式路由到目录。基于骆驼内容的路由器XPath空soap返回
这是我的骆驼上下文路径:
<route>
<from uri="cxf:bean:reportIncident?dataFormat=MESSAGE"/>
<choice>
<when>
<xpath>/*/*/*[local-name()='inputReportIncident']/*[local-name()='familyName']='Holt'</xpath>
<to uri="file:target/messages/contentbasedrouting/a?fileName=a.xml"/>
</when>
<otherwise>
<to uri="file:target/messages/contentbasedrouting/otherwise?fileName=otherwise.xml"/>
</otherwise>
</choice>
</route>
基于内容的路由器工作正常,但它发出了一个空白的XML文件的目录,我的SOAP消息已经一去不复返了。
如果我从一个目录而不是CXF端点拿起SOAP消息,它可以正常工作。如果我这样做:
<from uri="file:target/messages/incoming"/>
相反的:
<from uri="cxf:bean:reportIncident?dataFormat=MESSAGE"/>
任何想法,为什么?
谢谢
好吧,我想出了为什么。流类型只能读取一次。为了能够多次处理消息内容,该流需要被缓存。为此,请将streamCache =“true”添加到。有关更多信息,请参阅http://camel.apache.org/stream-caching.html。 –
Graham