...
The ServiceMix FTP component provides JBI integration to the FTP servers. It can be used to read & write files over FTPor FTP or to periodically poll directories for new files.
Maven Archetype
...
FTP Poller
Installing the The servicemix-ftp component can be done in several ways:
- drop the installer zip in an hotdeploy directory monitored by ServiceMix
- using ant tasks
Note that when using ant tasks, the component is not started, you will have to start it manually using ant tasks or a console.
XBean deployment
You can deploy Service Units containing a file named xbean.xml for activating consumer and provider endpoints.
This xml file should respect the given syntax, though this is a spring based xml configuration file from where all beans of class HttpEndpoint are retrieved.
See a full example here. Note that you have to define the ftp namespace with
...
<beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0">
...
</beans>
-poller-service-unit archetype creates a FTP Poller Service Unit:
Code Block |
---|
mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=servicemix-ftp-poller-service-unit \
-DarchetypeVersion=2010.01 \
-DgroupId=your.group.id \
-DartifactId=your.artifact.id \
-Dversion=your-version
|
FTP Sender
The servicemix-ftp-sender-service-unit archetype creates a FTP Sender Service Unit:
Code Block |
---|
mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=servicemix-ftp-sender-service-unit \
-DarchetypeVersion=2010.01 \
-DgroupId=your.group.id \
-DartifactId=your.artifact.id \
-Dversion=your-version
|
Endpoint Configuration
FTP Poller Endpoint
FTP
Any numbers of endpoints can be specified in the xbean.xml file.
Poller endpoint
Poller endpoints can be used to poll a FTP server directory for files, download them, and send an InOnly JBI exchange to the configured JBI service.
...
Info | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
FTP Sender
...
Endpoint
FTP Sender endpoints are used are provider endpoints (in the JBI sense) which accepts incoming InOnly exchanges and write the content of the exchange to a file on the FTP server.
Here is an example of a simple sender endpoint.:
Code Block | ||
---|---|---|
| ||
<ftp:sender service="test:service" endpoint="endpoint" uri="ftp://servicemix:rocks@localhost/smx/test" /> |
...