You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

ServiceMix File

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

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

Endpoints

Provider endpoint
<file:sender service="test:service"
               endpoint="endpoint"
               directory="file:target/pollerFiles" />
Polling (consumer) endpoint
<file:poller service="test:poller"
                      endpoint="poller"
                      targetService="test:receiver"
                      file="file:target/pollerFiles" />
Marshalers
<file:sender service="test:service" endpoint="endpoint" directory="file:target/componentOutput">
  <file:marshaler>
    <sm:defaultFileMarshaler>
      <sm:fileName>
        <!-- lets use a header from the message -->
        <sm:xpathString xpath="concat($name, '.xml')"/>
      </sm:fileName>
    </sm:defaultFileMarshaler>
  </file:marshaler>
</file:sender>

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

  • No labels