To understand how to build a route using XML, you must understand some of the basic concepts of the routing language, such as sources and targets, processors, expressions and predicates, and message exchanges. For definitions and explanations of these concepts see Basic Java DSL Syntax.
Example 3.3 shows an example of a basic route in XML, which connects a
source endpoint, SourceURL
, directly to a destination endpoint,
TargetURL
.
Example 3.3. Basic Route in XML
<camelContext id="CamelContextID
" xmlns="http://activemq.apache.org/camel/schema/spring"> <route> <from uri="SourceURL
"/> <to uri="TargetURL
"/> </route> </camelContext>
where CamelContextID
is an arbitrary, unique identifier for
the Camel context. The route is defined by a route
element, and there can
be multiple route
elements under the camelContext
element.