WSo2 Esb filtering messages to an output file

丶灬走出姿态 提交于 2019-12-12 02:39:58

问题


I am working with a filter mediator attempting to send messages to an output xml file. I have my sequence using a filter mediator based on a attribute value, if it is true I want to write the message to a new xml file in a certain directory. If it is false I will drop the record. Here is my sequence:

<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>

*I am using a template as you can see to write out to my new output file setting parameters for the file name and uri.

The result is the whole file is being written out to the directory not just the messages I want. I have been running google searches trying to see where I am going wrong. I assume at this point I may be using the Filter mediator incorrectly? Maybe there is a better way or mediator to use to accomplish this task? I would appreciate any thoughts or recommendations folks may have. Thanks for your time!

来源:https://stackoverflow.com/questions/32721334/wso2-esb-filtering-messages-to-an-output-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!