The basic requirements for configuring a sender endpoint are straightforward. You need to supply the following information:
the endpoint's name
the endpoint's service name
the file or directory to which files are written
All of this information is provided using attributes of the sender
element.
All endpoints in the ESB need to have a unique identity. An endpoint's identity is made up of two pieces:
a service name
an endpoint name
Table 3.1 describes the attributes used to identify a sender endpoint.
Table 3.1. Attributes for identifying a sender endpoint
You specify the location the sender endpoint writes files using the sender
element's directory
attribute. This attribute takes a URI that identifies a
location on the file system.
![]() | Important |
---|---|
Relative URIs are resolved from the directory in which the Fuse ESB container was started. |
Using the default marshaler, the name of the file is determined by the org.apache.servicemix.file.name property. This property is set on either the message exchange or the message by the endpoint originating the message exchange.
![]() | Important |
---|---|
The marshaler is responsible for determining the name of the file being written. For more information on marshalers see File Marshalers. |
Example 3.1 shows the configuration for a simple sender endpoint.
Example 3.1. Simple sender endpoint
<beans xmlns:file="http://servicemix.apache.org/file/1.0" xmlns:foo="http://servicemix.org/demo/"> <file:sender service="foo:fileSender" endpoint="sender" directory="outbox" /> ... </beans>