The Camel gateway is, by default, a synchronous gateway which allows the ESB to take advantage of the transports provided by the Apache Camel project (http://camel.apache.org/). This transport exposes its configuration by using the <camel-provider>
, <camel-bus>
, and <camel-gateway>
elements.
The gateway allows one or more transports to be defined using the Camel URI notification, either as a from-uri
attribute or a set of nested <from>
elements. It is also possible to override the timeout for synchronous invocations, using the timeout
attribute, or declare the gateway to be asynchronous by specifying the async
attribute.
These configurations can be specified on both the <camel-bus>
and <camel-gateway>
elements, allowing a deployment to share a configuration where appropriate.
A typical Camel provider configuration would look like this:
<camel-provider name="CamelProvider"> <camel-bus busid="chapter6CamelChannel"> <from uri="file://@INPUTDIR1@?delete=true"/> <from uri="http://localhost:9889"/> <from uri="jms://MyQueue?connectionFactory=ConnectionFactory"/> </camel-bus> </camel-provider>
With the Camel gateway the configuration looks as follows:
<camel-gateway busidref="chapter6CamelChannel" name="Chapter6CamelGwListener"/>
It is also possible to configure the gateway without a reference to the bus, specifying the attributes or elements directly on the
<camel-gateway>
element as shown:
<camel-gateway name="Chapter6CamelGwListener" from-uri="file://@INPUTDIR1@?delete=true"/>