Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The ServiceMix File component provides JBI integration to the file system. It can be used to read & write files via URI or to periodically poll directories for new files.

Note that this component is only available in releases >= 3.1.

URI

You can use the familiar file URI to communicate with files

Code Block

file:foo.xml
file://path/to/something

...

Maven Archetype

You have two archetypes available depending of you want a file poller or a file sender.

The servicemix-file-poller-service-unit archetype creates a File Poller Service Unit:

Code Block

mvn archetype:create \
  -DarchetypeGroupId=org.apache.servicemix.tooling \
  -DarchetypeArtifactId=servicemix-file-poller-service-unit \
  -DarchetypeVersion=2010.01 \
  -DgroupId=your.group.id \
  -DartifactId=your.artifact.id \
  -Dversion=your-version

The servicemix-file-sender-service-unit archetype creates a File Sender Service Unit:

Code Block

mvn archetype:create \
  -DarchetypeGroupId=org.apache.servicemix.tooling \
  -DarchetypeArtifactId=servicemix-file-sender-service-unit \
  -DarchetypeVersion=2010.01 \
  -DgroupId=your.group.id \
  -DartifactId=your.artifact.id \
  -Dversion=your-version

Endpoints Configuration

Code Block
langxml
titleProvider endpoint
<file:sender service="test:service"
             endpoint="endpoint"
             directory="file:target/pollerFiles" />

...

For all xbean file endpoint configuration take a look at Xml schemas

URI

You can use the familiar file URI to communicate with files

Code Block

file:foo.xml
file://path/to/something

Filtering

Filtering of files to use during the polling process can be accomplished by configuring the filter property.

...