WSO2 VFS FTP 代理不读取参数

WSO2 VFS FTP Proxy does not read parameters

我编写了一个代理服务并部署在 WSO2 ESB 5 上以通过 http 接收一些文件内容并使用 vfs 传输将该内容传输到 ftp 服务器。当我正确指定连接参数时,该服务按预期工作,但是当我在连接字符串上指定错误以模拟停机服务器时,我无法使用 [1] 中指定的参数来控制 VFS 传输的行为。我正在寻找的是缩短 VFS 中发生的错误与 Axis 捕获的故障异常之间的延迟;

正如您将在下面看到的,我指定了 0 次重试和 0 次重试之间的等待时间,但似乎 VFSTransportSender class 无法以某种方式读取这些值,因为它始终执行相同数量的重试并且每次执行时等待相同的秒数,我也更改了值并放置了其他值但结果始终相同,服务器总是重试 3 次,除了原始请求之外彼此之间有 30 秒的延迟在 Axis 能够接收到一些与错误相关的信息之前。

这是我的代理服务,没有任何问题:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="ftpProxy"
       startOnLoad="true"
       statistics="disable"
       trace="disable"
       transports="https,http">
   <target>
  <inSequence>
     <log level="full"/>
     <property expression="json-eval($.key)" name="file_name"/>
     <property name="OUT_ONLY" value="true"/>
     <property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/>
     <property name="HTTP_SC" scope="axis2" value="200"/>
     <property expression="fn:concat(get-property('file_name'), '.json')"
               name="transport.vfs.ReplyFileName"
               scope="transport"/>
     <property name="OUT_ONLY" value="true"/>
  </inSequence>
  <endpoint name="ftp_endpoint">
     <address uri="vfs:ftp://jairof_ftp:passftp@localhost:21">
        <timeout>
           <duration>2000</duration>
           <responseAction>fault</responseAction>
        </timeout>
        <suspendOnFailure>
           <errorCodes>-1</errorCodes>
           <progressionFactor>1.0</progressionFactor>
        </suspendOnFailure>
        <markForSuspension>
           <errorCodes>-1</errorCodes>
        </markForSuspension>
     </address>
  </endpoint>
   </target>
   <parameter name="transport.vfs.ReconnectTimeout">0</parameter>
   <parameter name="transport.vfs.MaxRetryCount">0</parameter>
   <description/>
</proxy>

当我想模拟服务器无法访问时,我只是修改了地址 URI,并将这个放在用户不正确的地方:

<address uri="vfs:ftp://ja8irof_ftp:passftp@localhost:21">

我也曾尝试在调用端点之前将 transport.vfs 参数设置为属性,但结果完全相同

在这里您可以检查部分日志文件,我在其中删除了部分堆栈跟踪以保持 post 简单:

[2016-10-29 12:23:01,134] ERROR - VFSTransportSender cannot resolve replyFile
org.apache.commons.vfs2.FileSystemException: Could not connect to FTP server on "localhost".
... (the rest of stack trace)
...
Caused by: org.apache.commons.vfs2.FileSystemException: Could not login to FTP server on "localhost" as user "ja8irof_ftp".
at org.apache.commons.vfs2.provider.ftp.FtpClientFactory.createConnection(FtpClientFactory.java:210)
... 29 more

[2016-10-29 12:23:34,223] ERROR - VFSTransportSender cannot resolve replyFile
org.apache.commons.vfs2.FileSystemException: Could not connect to FTP server on "localhost".
... (the rest of stack trace)
...
Caused by: org.apache.commons.vfs2.FileSystemException: Could not login to FTP server on "localhost" as user "ja8irof_ftp".
at org.apache.commons.vfs2.provider.ftp.FtpClientFactory.createConnection(FtpClientFactory.java:210)
... 29 more

[2016-10-29 12:24:07,842] ERROR - VFSTransportSender cannot resolve replyFile
org.apache.commons.vfs2.FileSystemException: Could not connect to FTP server on "localhost".
... (the rest of stack trace)
...
Caused by: org.apache.commons.vfs2.FileSystemException: Could not login to FTP server on "localhost" as user "ja8irof_ftp".
at org.apache.commons.vfs2.provider.ftp.FtpClientFactory.createConnection(FtpClientFactory.java:210)
... 29 more

[2016-10-29 12:24:07,844] ERROR - VFSTransportSender cannot resolve replyFile repeatedly: Could not connect to FTP server on "localhost".
org.apache.commons.vfs2.FileSystemException: Could not connect to FTP server on "localhost".        
... (the rest of stack trace)
...
Caused by: org.apache.commons.vfs2.FileSystemException: Could not login to FTP server on "localhost" as user "ja8irof_ftp".
at org.apache.commons.vfs2.provider.ftp.FtpClientFactory.createConnection(FtpClientFactory.java:210)
... 29 more

[2016-10-29 12:24:07,846] ERROR - Axis2Sender Unexpected error during sending message out
org.apache.axis2.AxisFault: cannot resolve replyFile repeatedly: Could not connect to FTP server on "localhost".
... (the rest of stack trace)
...
Caused by: org.apache.commons.vfs2.FileSystemException: Could not connect to FTP server on "localhost".
at org.apache.commons.vfs2.provider.ftp.FtpClientFactory.createConnection(FtpClientFactory.java:275)
at org.apache.commons.vfs2.provider.ftp.FTPClientWrapper.createClient(FTPClientWrapper.java:100)
at org.apache.commons.vfs2.provider.ftp.FTPClientWrapper.getFtpClient(FTPClientWrapper.java:134)
at org.apache.commons.vfs2.provider.ftp.FTPClientWrapper.<init>(FTPClientWrapper.java:59)
at org.apache.commons.vfs2.provider.ftp.FtpFileProvider.doCreateFileSystem(FtpFileProvider.java:128)
at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.getFileSystem(AbstractOriginatingFileProvider.java:155)
at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:119)
at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:88)
at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:738)
at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:626)
at org.apache.synapse.transport.vfs.VFSTransportSender.writeFile(VFSTransportSender.java:233)
... 19 more
Caused by: org.apache.commons.vfs2.FileSystemException: Could not login to FTP server on "localhost" as user "ja8irof_ftp".
at org.apache.commons.vfs2.provider.ftp.FtpClientFactory.createConnection(FtpClientFactory.java:210)
... 29 more     

请给我任何意见、建议...非常感谢,提前感谢您的宝贵时间。

[1] https://docs.wso2.com/display/ESB500/VFS+Transport

尝试将参数附加到端点 URL,就像这样。

<address uri="vfs:ftp://ja8irof_ftp:passftp@localhost:21?transport.vfs.MaxRetryCount=0&amp;transport.vfs.ReconnectTimeout=0"/>