How to handle VFS proxy error in WSO2 EI 6.4?

依然范特西╮ 提交于 2021-02-11 09:47:55

问题


In VFS proxy, How I can handle errors? For example in below cases:

  • If VFS is not able to connect to SFTP server due to different reasons(like wrong password, directory not exist etc). I am able to see Warning in console log but I want to send a mail or want to do some other stuff if connection is not possible.
  • If the folder does not exist where we have to move file after reading.

I am able to handle error during processing in FaultSequence but that thing does not work for proxy. I tried to set onError attribute as well but seems proxy does not support that attribute.

Please let me know if someone handle such errors or I am missing something.

    <proxy name="FileProxy" startOnLoad="false" statistics="enable" trace="enable" transports="vfs" xmlns="http://ws.apache.org/ns/synapse">
        <target faultSequence="Global_Error_Handler">
            <inSequence>
                <log level="custom">
                    <property name="status=" value="File received."/>
                </log>
            </inSequence>
            <outSequence/>
        </target>
        <parameter name="transport.vfs.Streaming">true</parameter>
        <parameter name="transport.PollInterval">10</parameter>
        <parameter name="transport.vfs.FileURI">vfs:sftp://abc:***@127.0.0.1:22/test/ftp_in?transport.vfs.AvoidPermissionCheck=true</parameter>
        <parameter name="transport.vfs.ContentType">text/plain</parameter>
        <parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
        <parameter name="transport.vfs.MoveAfterFailure">vfs:sftp://abc:***@127.0.0.1:22/test/ftp_failure</parameter>
        <parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
        <parameter name="transport.vfs.ReplyFileName">ReplyFileName.csv</parameter>
        <parameter name="transport.vfs.FileNamePattern">.*.dat</parameter>
        <parameter name="transport.vfs.MoveAfterProcess">file:///home/test/ftp_process</parameter>
    </proxy>

Need to handle any error that occurs outside the <target> functionality of proxy for VFS.

来源:https://stackoverflow.com/questions/57799952/how-to-handle-vfs-proxy-error-in-wso2-ei-6-4

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