VFS Transport
VFS (Virtual File System) transport implementation is a module which belongs to the Apache Synapse project. The following classes implement the listener and sender APIs.
org.apache.synapse.transport.vfs.VFSTransportListener
org.apache.synapse.transport.vfs.VFSTransportSender
The necessary classes can be found in the synapse-vfs-transport.jar
file. Unlike the transports described previously, VFS transport does not have any global parameters to be configured. Rather, it has a set of service level parameters that needs to be specified for each service. VFS transport implementation is mainly used and mostly effective in the WSO2 ESB.
Starting from Carbon version 4.0.0, VFS transport supports the FTPS protocol. Configuration is identical to other protocols with the only difference being the URL prefixes.
The VFS transport implementation is based on Apache Commons VFS implementation. Therefore commons-vfs.jar
file should be included in the Carbon classpath to enable the VFS transport.
Since VFS transport deals with file operations, there are instances that these can fail due to unavailability of some resource. In such an instance, the VFS transport is equipped with the following fault-handling mechanism.
When a failure occurs in a file object, that will be marked as a fail record and will be moved to location (configured by the user) where move error file objects are kept. The failed record will be maintained inside a text file (file name is configurable) and the location of that file will be provided by the user. When the next polling iteration is going on, it will check the file against the failed record and if the file is a failed record, it will skip processing and schedule a move task to move that file (the retry duration of the file move task can be configured). It's handled this way because it is a random failure in the move operation.
VFS Service Level Parameters
Tip
In transport parameter tables, literals displayed in italic mode under the "Possible Values" column should be considered as fixed literal constant values. Those values can be directly put in transport configurations.
Parameter Name | Description | Required | Possible Values | Default Value |
---|---|---|---|---|
transport.vfs. | The file URL from | Yes | A valid file URL | Â |
transport.vfs. | Content type of the files | Yes | A valid content | Â |
transport.vfs. | If the VFS listener | No | A regular | Â |
transport. | The polling interval in | No | A positive integer | Â |
transport.vfs. | Action to perform | No | MOVE, | DELETE |
transport.vfs. | Action to perform | No | MOVE, | DELETE |
transport.vfs. | The location to | Required if | A valid file URI | Â |
transport.vfs. | The location to | Required if | A valid file URI | Â |
transport.vfs. | The location to | No | A valid file URI | Â |
transport.vfs. | The name for reply files | No | A valid file | response.xml |
transport.vfs. | The pattern/format | No | A valid timestamp | Â |
transport.vfs. | If files should be transferred | No | true, false | false |
transport.vfs. | Reconnect timeout | No | A positive | 30 sec |
transport.vfs. | Maximum number of | No | A positive | 3 |
transport.vfs. | When writing the | No | true, false | false |
transport.vfs. | New destination | No | A valid file URI | Â |
transport.vfs. | The file name to maintain | No | A valid file name | vfs-move- |
transport.vfs. | The destination of the | No | A folder URI | repository |
transport.vfs. | When adding a record | No | A valid timestamp | dd-MM- |
transport.vfs. | The time in milli | No | A positive | 3000 milli |
You can find a VFS transport implementation in this tutorial: http://wso2.org/library/tutorials/2011/01/sftp-file-transer-wso2-esb