camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Muhammad Ichsan <>
Subject Re: Possibility of using inOut
Date Wed, 01 Sep 2010 03:17:14 GMT
2010/8/31 Claus Ibsen <>

> Read chapter 7 in the Camel book how to do request/reply over JMS.
> The 2nd route (amq:input) will "detect" the JMSReplyTo header
> automatic and automatic return back the reply. So you don't have to do
> that manually.
> Just at the end of the routing the message is send back to the
> JMSReplyTo destination.

Sorry, I think you don't get it. The communicator is a socket bean which
maintain connection to remote host. A message sent to it can be a request
(which we can wait a response) and can be also a response.

When a response is coming in from bean:communicator?method=readResponse,
then I have to make the correlation id is the same with corresponding
request and it is sent back to amq:output. Else (when a request coming
from bean:communicator?method=readResponse), I just throw it to another
queue and do not care about correlation id.

The problem is I don't know exactly how to implement this communicator. This
is my snippet:

void justSendNoWait(Exchange x) {
       MyMessage m = x.getIn().getBody(MyMessage.class);
       if (m.isRequest()) {

           x.setPattern(ExchangePattern.InOnly); // I don't know if this is
necessary to make the message not delivered to it's caller, but instead wait
for future response

void readResponse(Exchange x) {
      MyMessage m = x.getIn().getBody(MyMessage.class);
      if (m.isResponse()) {
          String cid = readCorrelationId(m.getTraceNumber());
          x.getOut().setHeader("JMSCorrelationID", cid);

Is this correct? I have problem with this.


~The best men are men who benefit to others 一緒に勉強しましょう!

Yang berkualitas memang beda rasanya!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message