title: WSO2 VFS FTP Proxy does not read parameters
body: <p>I have written a proxy service and deployed on WSO2 ESB 5 to receive some file content via http and use vfs transport to transfer that content to an ftp server.  The service works as expected when I specify the connection parameters correctly but when I specify something wrong on the connection string to simulate a down server, I can not manage to control the behavior of the VFS transport using the parameters specified in [1]. What I'm looking for is to short the delay between the error occurred in VFS and the fault exception catched by Axis; </p>
  
  <p>As you are going to see below I specify 0 retries and 0 wait time between retries but it seems the VFSTransportSender class is not able to read somehow those values because it does all the time the same number of retries and it waits the same number of seconds each time it is executed, I also changed the values and put others but the result is always the same, the server is always retrying 3 more times with 30 seconds delay between each other besides the original request before Axis is able to receive some information related to the error.</p>
  
  <p>Here is my proxy service that works without any issues:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;proxy xmlns="http://ws.apache.org/ns/synapse"
         name="ftpProxy"
         startOnLoad="true"
         statistics="disable"
         trace="disable"
         transports="https,http"&gt;
     &lt;target&gt;
    &lt;inSequence&gt;
       &lt;log level="full"/&gt;
       &lt;property expression="json-eval($.key)" name="file_name"/&gt;
       &lt;property name="OUT_ONLY" value="true"/&gt;
       &lt;property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/&gt;
       &lt;property name="HTTP_SC" scope="axis2" value="200"/&gt;
       &lt;property expression="fn:concat(get-property('file_name'), '.json')"
                 name="transport.vfs.ReplyFileName"
                 scope="transport"/&gt;
       &lt;property name="OUT_ONLY" value="true"/&gt;
    &lt;/inSequence&gt;
    &lt;endpoint name="ftp_endpoint"&gt;
       &lt;address uri="vfs:ftp://jairof_ftp:passftp@localhost:21"&gt;
          &lt;timeout&gt;
             &lt;duration&gt;2000&lt;/duration&gt;
             &lt;responseAction&gt;fault&lt;/responseAction&gt;
          &lt;/timeout&gt;
          &lt;suspendOnFailure&gt;
             &lt;errorCodes&gt;-1&lt;/errorCodes&gt;
             &lt;progressionFactor&gt;1.0&lt;/progressionFactor&gt;
          &lt;/suspendOnFailure&gt;
          &lt;markForSuspension&gt;
             &lt;errorCodes&gt;-1&lt;/errorCodes&gt;
          &lt;/markForSuspension&gt;
       &lt;/address&gt;
    &lt;/endpoint&gt;
     &lt;/target&gt;
     &lt;parameter name="transport.vfs.ReconnectTimeout"&gt;0&lt;/parameter&gt;
     &lt;parameter name="transport.vfs.MaxRetryCount"&gt;0&lt;/parameter&gt;
     &lt;description/&gt;
  &lt;/proxy&gt;
  </code></pre>
  
  <p>And when I want to simulate the server is not reachable I just modify the address URI and I put this one where the user is incorrect:</p>
  
  <p><code>&lt;address uri="vfs:ftp://ja8irof_ftp:passftp@localhost:21"&gt;</code></p>
  
  <p>I have also tried to set the transport.vfs parameters as properties before calling the endpoint but the result is exactly the same</p>
  
  <p>Here you can inspect part of the log file where I cut some parts of the stack trace to keep the post simple:</p>
  
  <pre><code>[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.&lt;init&gt;(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     
  </code></pre>
  
  <p>Please send me any comments, suggestions... I would appreciate so much, thanks in advance for your time.</p>
  
  <p>[1] <a href="https://docs.wso2.com/display/ESB500/VFS+Transport" rel="nofollow">https://docs.wso2.com/display/ESB500/VFS+Transport</a>  </p>