You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Peter Klotz <pe...@blue-elephant-systems.com> on 2006/03/29 10:05:53 UTC

Synchronized reply with JMS

Hi,

ServiceMix is able to have a synchronous request/response interaction e.g. when
a HTTP request comes in an is forwarded to some other service the reply from
this service can be returned as the HTTP request's response.

The problem that I have is that I have a HTTP server that receives a request and
forwards that to a JMS queue. The response of the component that listens on the
JMS queue answers another JMS queue and I would like to return this response as
the HTTP server's response.


HTTP    ------> JMS queue ------> some
Server  <------ JMS queue <------ adaptor

The problem is that the adaptor works really asynchronous that is why I would
like to use a JMS queue for interaction. But how can one synchronize the JMS
interaction with the HTTP server again? The HTTP server does not wait for the
response of the other JMS queue and then complains that he did not get an response.

I would have though that using the JMS ReplyTo property would be the solution,
but this does not seem to be used in the corresponding Spring/ServiceMix
components. Has anybody done something like this before or has an idea how to
solve this problem?

Also I tried to use the ServiceMix client API but if I cannot get this
synchronized in the adaptor then I have the same problem. As soon as the API
callback is finished the HTTP server gets and empty response and does not wait
on the asynchronous response from the adaptor.


Thanks, Peter

Re: Synchronized reply with JMS

Posted by Guillaume Nodet <gn...@gmail.com>.
Hi Peter,

I'm sorry I do not fully understand the problem.  Where is ServiceMix
in your app ?
What component do you use ?  The servicemix-jms component can handle
in-out MEP so there should be no problem with it...

Cheers,
Guillaume Nodet

On 3/29/06, Peter Klotz <pe...@blue-elephant-systems.com> wrote:
> Hi,
>
> ServiceMix is able to have a synchronous request/response interaction e.g. when
> a HTTP request comes in an is forwarded to some other service the reply from
> this service can be returned as the HTTP request's response.
>
> The problem that I have is that I have a HTTP server that receives a request and
> forwards that to a JMS queue. The response of the component that listens on the
> JMS queue answers another JMS queue and I would like to return this response as
> the HTTP server's response.
>
>
> HTTP    ------> JMS queue ------> some
> Server  <------ JMS queue <------ adaptor
>
> The problem is that the adaptor works really asynchronous that is why I would
> like to use a JMS queue for interaction. But how can one synchronize the JMS
> interaction with the HTTP server again? The HTTP server does not wait for the
> response of the other JMS queue and then complains that he did not get an response.
>
> I would have though that using the JMS ReplyTo property would be the solution,
> but this does not seem to be used in the corresponding Spring/ServiceMix
> components. Has anybody done something like this before or has an idea how to
> solve this problem?
>
> Also I tried to use the ServiceMix client API but if I cannot get this
> synchronized in the adaptor then I have the same problem. As soon as the API
> callback is finished the HTTP server gets and empty response and does not wait
> on the asynchronous response from the adaptor.
>
>
> Thanks, Peter
>
>