Question

I have some doubts about how VFS proxy services work on WSO2 ESB 4.8.0.

I prepared the following test service:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="testvfs"
       transports="vfs"
       statistics="enable"
       trace="enable"
       startOnLoad="true">
   <target>
      <inSequence>
         <log level="full">
            <property name="test" value="before error"/>
         </log>
         <dbreport>
            <connection>
               <pool>
                  <password>admin</password>
                  <user>admin</user>
                  <url>adfs</url>
                  <driver>dfsa</driver>
               </pool>
            </connection>
            <statement>
               <sql>select 1;</sql>
            </statement>
         </dbreport>
         <log level="full">
            <property name="test" value="after error"/>
         </log>
      </inSequence>
   </target>
   <parameter name="transport.PollInterval">1</parameter>
   <parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
   <parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
   <parameter name="transport.vfs.FileURI">file://C:\testvfs\in</parameter>
   <parameter name="transport.vfs.MoveAfterProcess">file://C:\testvfs\out</parameter>
   <parameter name="transport.vfs.MoveAfterFailure">file://C:\testvfs\original</parameter>
   <parameter name="transport.vfs.FileNamePattern">.*.csv</parameter>       
   <parameter name="transport.vfs.ContentType">text/plain</parameter>

   <description/>
</proxy>

It should:

  • wait for a file to appear in C:\testvfs\in
  • process the file (in my example, do log-dbreport-log sequence)
  • if the processing was successful, move the file to C:\testvfs\out
  • if there was a failure, the file should go to C:\testvfs\original

At least that's how I understand the VFS transport and it's parameters.

I intentionally corrupted dbreport mediator (incorrect url and driver class). I expected every input to be transferred to \original directory as the processing always fail.

Instead, the file goes to \out directory.

Am I missing something or is it a bug in 4.8.0?

Was it helpful?

Solution

This is not a bug. WSO2 Enterprise Serivce Bus (ESB) has been implemented in way to handle the errors while reading the message OR Processing the message via MoveAfterFailure.

If you want to handles the endpoint failure OR DB failure you have to use the error handling techniques used in WSO2 ESB.

[1] http://docs.wso2.org/display/ESB480/Error+Handling

[2] http://wso2.com/library/articles/wso2-enterprise-service-bus-endpoint-error-handling/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top