This documentation is for WSO2 ESB version 4.6.0. View documentation for the latest release.

Skip to end of metadata
Go to start of metadata

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

To enable the VFS transport, edit the <ESB_HOME>/repository/conf/axis2/axis2.xml file and uncomment the VFS listener and the VFS sender as follows:

<transportreceiver name="vfs" class="org.apache.synapse.transport.vfs.VFSTransportListener"/>
...
<transportSender name="vfs" class="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 WSO2 ESB.

Starting from version 4.0, VFS transport supports FTPS protocol ( New in version 4.0 ). 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 certain time that these can fail due to unavailability of some resource. In such a case 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 maintain 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). This is handle this way because this is random failure in 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.
FileURI

The file URL from
where the input files
 should be fetched.

Yes

A valid file URL
of the form file://
file://<path>

 

transport.vfs.
ContentType

Content type of the files
transferred over the transport.

Yes

A valid content
type for the
files (eg: text/xml)

 

transport.vfs.
FileName
Pattern

If the VFS listener
should read only a
subset of all the files
available in the
specified file URI
location, this parameter
can be used to select
those files by name
using a regular
expression.

No

A regular
expression to
select files by
name
(eg:.*\.xml)

 

transport.
PollInterval

The polling interval in
milliseconds for the
transport receiver to
poll the file URI
location.

No

A positive integer

 

transport.vfs.
ActionAfter
Process

Action to perform
over the files after
processed by
the transport.

No

MOVE,
DELETE

DELETE

transport.vfs.
ActionAfter
Failure

Action to perform
over the files after
processed by
the transport.

No

MOVE,
DELETE

DELETE

transport.vfs.
MoveAfter
Process

The location to
move the files
after processing.

Required if
ActionAfterProcess
is MOVE

A valid file URI

 

transport.vfs.
MoveAfter
Failure

The location to
move the files
after a failure
occurs.

Required if
ActionAfterFailure
is MOVE

A valid file URI

 

transport.vfs.
ReplyFileURI

The location to
which reply files
should be written
by the transport.

No

A valid file URI

 

transport.vfs.
ReplyFile
Name

The name for reply files
written by the transport.

No

A valid file
name

response.xml

transport.vfs.
Move
Timestamp
Format

The pattern/format
of the  timestamps
added to file names
as prefixes when
moving files (See
the API documentation
of java.text.
SimpleDateFormat
for details).

No

A valid timestamp
pattern
(eg: yyyy-MM-
dd'T'HH:mm
:ss.SSSZ)

 

transport.vfs.
Streaming

If files should be transferred
in streaming mode or not.

No

true, false

false

transport.vfs.
Reconnect
Timeout

Reconnect timeout
value in seconds
to be used in
case of an error
when  transferring
files.

No

A positive
integer

30 sec

transport.vfs.
MaxRetry
Count

Maximum number of
retry attempts to
carry out  in case
of errors.

No

A positive
integer

3

transport.vfs.
Append

When writing the
response to a file,
if the response
should be appended
to the response file
this parameter
should be set to
true.

This should be
defined as a query
parameter in out/reply
file URI(ex: " vfs:file:
///home/user/test/out?
transport.vfs.Append=true "
or <parameter name="
transport.vfs.ReplyFileURI">
file:///home/user/test/out?
transport.vfs.Append=true
</parameter>).

By default the
response  file will
be completely
overwritten.

No

true, false

false

transport.vfs.
MoveAfter
FailedMove

New destination
to move the
failed file.

No

A valid file URI

 

transport.vfs.
Failed
Records
FileName

The file name to maintain
the list of failure files.

No

A valid file name

vfs-move-
failed-
records.
properties

transport.vfs.
Failed
Records
File
Destination

The destination of the
failed file.

No

A folder URI

repository
/conf/

transport.vfs.
Move
Failed
Record
Timestamp
Format

When adding record
to the failed file,
entries is logged
the as:
file_name
time_stamp.
This will configure
the time stamp
format.

No

A valid timestamp
pattern (eg: yyyy-
MM-dd'T'HH:mm:
ss.SSSZ)

dd-MM-
yyyy
HH:mm
:ss

transport.vfs.
Failed
Record
Next
Retry
Duration

The time in milli
second for the
move task to wait
until next retry.

No

A positive
integer

3000 milli
seconds

transport.vfs.Locking

By-default file locking is
turned on in the VFS transport,
and this parameter lets you configure
the locking behaviour on a per service basis.
Possible values are enable or disable ,
and both these values are important
because the locking can be disabled
at the global level by specifying
that at the receiver level and
selectively enable locking only for a set of services.

No

enable or disable

enable

Please, refer Using the file system as transport medium (VFS) on how to use the VFS transport in real world applications.

  • No labels