WSo2 Esb过滤消息到输出文件

时间:2015-09-22 15:49:03

标签: filter wso2 esb mediator

我正在使用过滤介体尝试将消息发送到输出xml文件。我的序列使用基于属性值的过滤器中介,如果是,我想将消息写入某个目录中的新xml文件。如果它是假的我将删除记录。 这是我的序列:

<sequence xmlns="http://ws.apache.org/ns/synapse" name="RenaissanceIqtFilterSequence">
   <log level="custom">
      <property name="sequence" value="FilterSequence"></property>
   </log>
   <filter xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:ns="http://org.apache.synapse/xsd" xmlns:z="RowsetSchema" xpath="//z:row/@name='RP'">
      <then>
         <log level="custom">
            <property name="sequence" value="Condition Write"></property>
         </log>
         <call-template target="FileWriteTemplate">
            <with-param name="targetFileName" value="NEW_MESSAGE_FILE"></with-param>
            <with-param name="addressUri" value="vfs:file:///var/process/rrout"></with-param>
         </call-template>
      </then>
      <else>
         <log level="custom">
            <property name="sequence" value="Condition Drop"></property>
         </log>
         <drop></drop>
      </else>
   </filter>
</sequence>

*我正在使用模板,因为您可以看到写出我的新输出文件设置文件名和uri的参数。

结果是整个文件被写入目录,而不仅仅是我想要的消息。我一直在运行谷歌搜索,试图看看我哪里出错了。我假设此时我可能错误地使用Filter mediator?也许有更好的方法或调解员来完成这项任务?我很感激人们的任何想法或建议。谢谢你的时间!

0 个答案:

没有答案
相关问题