5.3. Message Endpoint
Figure 5.3. Message Endpoint Pattern
Types of endpoint
- Consumer endpoint — Appears at the start of a Apache Camel route and reads In messages from an incoming channel (equivalent to a receiver endpoint).
- Producer endpoint — Appears at the end of a Apache Camel route and writes In messages to an outgoing channel (equivalent to a sender endpoint). It is possible to define a route with multiple producer endpoints.
- Endpoint URI for a consumer endpoint — Advertises a specific location (for example, to expose a service to which senders can connect). Alternatively, the URI can specify a message source, such as a message queue. The endpoint URI can include settings to configure the endpoint.
- Endpoint URI for a producer endpoint — Contains details of where to send messages and includes the settings to configure the endpoint. In some cases, the URI specifies the location of a remote receiver endpoint; in other cases, the destination can have an abstract form, such as a queue name.
Foo.Bar, you can define an endpoint URI like the following:
file://local/router/messages/foo, directly to the producer endpoint,
jms:Foo.Bar, you can use the following Java DSL fragment:
<camelContext id="CamelContextID" xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="file://local/router/messages/foo"/> <to uri="jms:Foo.Bar"/> </route> </camelContext>