camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Vellosa <nab...@vellosa.co.uk>
Subject JMS using inOut, but expecting multiple responses?
Date Wed, 13 Feb 2013 21:10:20 GMT
Hello. Please forgive me if this is a basic question, but I have been hunting
through the Camel documentation and patterns and not found what I’m looking
for. 

I have a JMS infrastructure which is passing messages between two systems. I
have created a simple camel route, something along the lines of:

from	(jms:RequestSystemA).
inOut	 (jms:RequestSystemB?ReplyTo=ResponseSystemB).
to 	(jms:ResponseSystemA);

(The actual route contains some processing along the way, but I left this
out for the sake of simplification)

This is working for my basic cases. However, when a request is sent to
system B, it sometime simply returns a response and other times will send
back multiple messages to say that the request is being processed, and then
at a later time the final response is sent. This whole process can take up
to a two minutes to complete. 

So what I would like is to create a route, something like:

Get message from system A and send it to system B.
Listen to a response from system B with a matching correlation ID.
if the response is a status update, send it to System A
But continue to listen for the next message (also possibly a status update)
If the message is the processing result, send that to system A
and end the job.

So maybe something like...

from	( jms:RequestSystemA ).
inOut 	( jms:RequestSystemB?ReplyTo=ResponseSystemB ).
loop 	().while( messageType = statusUpdate ).
	to ( jms:ResponseSystemA ).
	from ( jms:ResponseSystemB ).
end	().
to 	( jms:ResponseSystemA );

Each of the status updates as well as the final response all come from
system B with the same correlation id. 

Is something like this possible?

Thanks for any assistance.



--
View this message in context: http://camel.465427.n5.nabble.com/JMS-using-inOut-but-expecting-multiple-responses-tp5727561.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message