You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by saiya-jin001 <ma...@barclays.com> on 2015/01/29 14:17:27 UTC

Exposing request/response Web Service that would interact with legacy system

Hi,
as title says, I will have to expose concurrent WS, that would expose
request/response behavior to our legacy system. 
This legacy system has a JMS-like access API, meaning when request is
inserted into system, communication ends (ie there is no response to this
request other than return code) and asynchronously via Listeners I can
receive actual response.
This response would need to be paired to original request (still hanging
until timeout happens) and sent back as WS response.

Since there might be multiple requests at +- same time, there will be a pool
of incoming connections waiting to be served (I would expect accessible via
Camel API somehow).

I hope I described the topic in understandable way, feel free to ask as much
as necessary.
Can anybody please point me to right direction where to look for
solution/proper approach?

Thank you




--
View this message in context: http://camel.465427.n5.nabble.com/Exposing-request-response-Web-Service-that-would-interact-with-legacy-system-tp5762229.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Exposing request/response Web Service that would interact with legacy system

Posted by saiya-jin001 <ma...@barclays.com>.
thank you, I'll take a look into it



--
View this message in context: http://camel.465427.n5.nabble.com/Exposing-request-response-Web-Service-that-would-interact-with-legacy-system-tp5762229p5762392.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Exposing request/response Web Service that would interact with legacy system

Posted by ychawla <pr...@gmail.com>.
Have you look into the Camel Aggregator pattern?

http://camel.apache.org/aggregator.html

If you have any mechanism in the request/response message to correlate a
request to a response, you can set up the aggregator to collect your
response from a separate route and match the request/response using
something in the message or a header.  You can also set it up to timeout as
well.

I use this pattern to aggregate asynchronous web services with timeouts.



--
View this message in context: http://camel.465427.n5.nabble.com/Exposing-request-response-Web-Service-that-would-interact-with-legacy-system-tp5762229p5762391.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Exposing request/response Web Service that would interact with legacy system

Posted by saiya-jin001 <ma...@barclays.com>.
Hi,
thank you for your response. I see an issue that legacy API is "JMS like",
not really supporting things like replyTo headers, or queues whatsoever
among other things. 
It's more about communication type - request goes one way, and then
asynchronously response comes from another place. I am a bit worried that I
will have to implement this behavior manually, ie listener callback with
response being propagated back to request. Having multiple thread scenario
adds a bit of complexity on top of that.
Or is there any way of reusing already-existing Camel functionality (or
other frameworks like Spring)?
Thank oyu



--
View this message in context: http://camel.465427.n5.nabble.com/Exposing-request-response-Web-Service-that-would-interact-with-legacy-system-tp5762229p5762390.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Exposing request/response Web Service that would interact with legacy system

Posted by Willem Jiang <wi...@gmail.com>.
Camel Jms[1] provides request/reply implementation, you need to specify the Message Exchange pattern to InOut, and make sure you setup replyTo message header.
Using ProducerTemplate[2] in the WS implementation, you can just redirect the request into the JMS queue and handler the response there.

[1]https://camel.apache.org/jms
[2]http://camel.apache.org/producertemplate.html
--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 29, 2015 at 9:41:14 PM, saiya-jin001 (martin.francisty@barclays.com) wrote:
> Hi,
> as title says, I will have to expose concurrent WS, that would expose
> request/response behavior to our legacy system.
> This legacy system has a JMS-like access API, meaning when request is
> inserted into system, communication ends (ie there is no response to this
> request other than return code) and asynchronously via Listeners I can
> receive actual response.
> This response would need to be paired to original request (still hanging
> until timeout happens) and sent back as WS response.
>  
> Since there might be multiple requests at +- same time, there will be a pool
> of incoming connections waiting to be served (I would expect accessible via
> Camel API somehow).
>  
> I hope I described the topic in understandable way, feel free to ask as much
> as necessary.
> Can anybody please point me to right direction where to look for
> solution/proper approach?
>  
> Thank you
>  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Exposing-request-response-Web-Service-that-would-interact-with-legacy-system-tp5762229.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>