JBI Support deprecated in Apache ServiceMix 4

JBI 1.0 support is available in Apache ServiceMix 4 to allow existing users to migrate more easily to this latest version - if you're a new user, you should consider JBI deprecated and not use it for your project. Take a look at our technology selection guidelines for more information.

servicemix-vfs

Overview

The ServiceMix VFS component provides support for reading from and writing to virtual file systems via the enterprise service bus by using the Apache commons-vfs library.

Namespace and xbean.xml

The namespace URI for the servicemix-bean JBI component is http://servicemix.apache.org/vfs/1.0. This is an example of an xbean.xml file with a namespace definition with prefix bean.

<beans xmlns:vfs="http://servicemix.apache.org/vfs/1.0">

  <!-- add vfs:poller or vfs:sender here -->

</beans>

Endpoint types

The servicemix-vfs component defines two endpoint types:

  • vfs:poller :: Periodically polls a directory on one of the VFS-supported file systems for files and sends an exchange for every file

  • vfs:sender :: Writes the contents of an exchange to a file on one of the VFS-supported file systems

vfs:poller

Endpoint properties

Property Name Type Description
comparator java.util.Comparator Specifies a <code>Comparator</code> object.
component org.apache.servicemix.common.DefaultComponent the default component
concurrentExchange boolean
concurrentPolling boolean Sets whether more than one poll can be active at a time (true means yes). Default value is <code>false</code>.
delay long Sets the amount of time in milliseconds that the endpoint should wait before making the first poll.
deleteFile boolean Specifies if files should be deleted after they are processed. Default value is <code>true</code>.
endpoint java.lang.String The name of the endpoint.
fileSystemManager org.apache.commons.vfs.FileSystemManager sets the file system manager
firstTime java.util.Date Sets the date on which the first poll will be executed. If a delay is also set using <code>setDelay</code>, the delay interval will be added after the date specified.
interfaceName javax.xml.namespace.QName The qualified name of the interface exposed by the endpoint.
lockManager org.apache.servicemix.common.locks.LockManager Bean defining the class implementing the file locking strategy. This bean must be an implementation of the <code>org.apache.servicemix.locks.LockManager</code> interface. By default, this will be set to an instances of <code>org.apache.servicemix.common.locks.impl.SimpleLockManager</code>.
marshaler org.apache.servicemix.components.util.FileMarshaler Specifies a <code>FileMarshaler</code> object that will marshal file data into the NMR. The default file marshaller can read valid XML data. <code>FileMarshaler</code> objects are implementations of <code>org.apache.servicemix.components.util.FileMarshaler</code>.
path java.lang.String Specifies a String object representing the path of the file/folder to be polled.

Examples:
  • file:///home/lhein/pollFolder
  • zip:file:///home/lhein/pollFolder/myFile.zip
  • jar:http://www.myhost.com/files/Examples.jar
  • jar:../lib/classes.jar!/META-INF/manifest.mf
  • tar:gz:http://anyhost/dir/mytar.tar.gz!/mytar.tar!/path/in/tar/README.txt
  • tgz:file://anyhost/dir/mytar.tgz!/somepath/somefile
  • gz:/my/gz/file.gz
  • http://myusername@somehost/index.html
  • webdav://somehost:8080/dist
  • ftp://myusername:mypassword@somehost/pub/downloads/somefile.tgz
  • sftp://myusername:mypassword@somehost/pub/downloads/somefile.tgz
  • smb://somehost/home
  • tmp://dir/somefile.txt
  • res:path/in/classpath/image.png
  • ram:///any/path/to/file.txt
  • mime:file:///your/path/mail/anymail.mime!/filename.pdf

vfs:sender

Endpoint properties

Property Name Type Description
endpoint java.lang.String The name of the endpoint.
fileSystemManager org.apache.commons.vfs.FileSystemManager sets the file system manager
interfaceName javax.xml.namespace.QName The qualified name of the interface exposed by the endpoint.
marshaler org.apache.servicemix.components.util.FileMarshaler Specifies a <code>FileMarshaler</code> object that will marshal file data into the NMR. The default file marshaller can read valid XML data. <code>FileMarshaler</code> objects are implementations of <code>org.apache.servicemix.components.util.FileMarshaler</code>.
path java.lang.String Specifies a String object representing the path of the file/folder to be polled.

Examples:
  • file:///home/lhein/pollFolder
  • zip:file:///home/lhein/pollFolder/myFile.zip
  • jar:http://www.myhost.com/files/Examples.jar
  • jar:../lib/classes.jar!/META-INF/manifest.mf
  • tar:gz:http://anyhost/dir/mytar.tar.gz!/mytar.tar!/path/in/tar/README.txt
  • tgz:file://anyhost/dir/mytar.tgz!/somepath/somefile
  • gz:/my/gz/file.gz
  • http://myusername@somehost/index.html
  • webdav://somehost:8080/dist
  • ftp://myusername:mypassword@somehost/pub/downloads/somefile.tgz
  • sftp://myusername:mypassword@somehost/pub/downloads/somefile.tgz
  • smb://somehost/home
  • tmp://dir/somefile.txt
  • res:path/in/classpath/image.png
  • ram:///any/path/to/file.txt
  • mime:file:///your/path/mail/anymail.mime!/filename.pdf