Red Hat Training

A Red Hat training course is available for Red Hat Fuse

11.2. Basic configuration

Overview

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.

Identifying the endpoint

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 11.1, “Attributes for identifying a sender endpoint” describes the attributes used to identify a sender endpoint.

Table 11.1. Attributes for identifying a sender endpoint

NameDescription
service Specifies the service name of the endpoint. This value must be a valid QName and does not need to be unique across the ESB.
endpoint Specifies the name of the endpoint. This value is a simple string. It must be unique among all of the endpoints associated with a given service name.

Specifying the file destination

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 Red Hat JBoss Fuse 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 Chapter 12, File Marshalers.

Example

Example 11.1, “Simple sender endpoint” shows the configuration for a simple sender endpoint.

Example 11.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>