blob: 8cf458265698079c58ede20b111a59b91d779608 [file] [log] [blame]
[[RequestReply-RequestReply]]
Request Reply
~~~~~~~~~~~~~
Camel supports the
http://www.enterpriseintegrationpatterns.com/RequestReply.html[Request
Reply] from the link:enterprise-integration-patterns.html[EIP patterns]
by supporting the link:exchange-pattern.html[Exchange Pattern] on a
link:message.html[Message] which can be set to *InOut* to indicate a
request/reply. Camel link:components.html[Components] then implement
this pattern using the underlying transport or protocols.
image:http://www.enterpriseintegrationpatterns.com/img/RequestReply.gif[image]
For example when using link:jms.html[JMS] with InOut the component will
by default perform these actions
* create by default a temporary inbound queue
* set the JMSReplyTo destination on the request message
* set the JMSCorrelationID on the request message
* send the request message
* consume the response and associate the inbound message to the request
using the JMSCorrelationID (as you may be performing many concurrent
request/responses).
[TIP]
====
*Related*
See the related link:event-message.html[Event Message] message
====
[[RequestReply-ExplicitlyspecifyingInOut]]
Explicitly specifying InOut
^^^^^^^^^^^^^^^^^^^^^^^^^^^
When consuming messages from link:jms.html[JMS] a Request-Reply is
indicated by the presence of the *JMSReplyTo* header.
You can explicitly force an endpoint to be in Request Reply mode by
setting the exchange pattern on the URI. e.g.
[source,java]
---------------------------------
jms:MyQueue?exchangePattern=InOut
---------------------------------
You can specify the exchange pattern in DSL rule or Spring
configuration.
[[RequestReply-UsingThisPattern]]
Using This Pattern
++++++++++++++++++
If you would like to use this EIP Pattern then please read the
link:getting-started.html[Getting Started], you may also find the
link:architecture.html[Architecture] useful particularly the description
of link:endpoint.html[Endpoint] and link:uris.html[URIs]. Then you could
try out some of the link:examples.html[Examples] first before trying
this pattern out.