I've drawn up a rough diagram to try and clear up what I am attempting
to describe.
http://public.mgilday.imap.cc/routes.png
Here source 2 is a client (at the moment a Struts 2 action) which
performs some rudimentary operations through a Spring based service to
persist incoming data. It then places a message which is destined for
trade.queue. This is then consumed by a Spring service bean which
returns details of the trade. This result should be returned to the
original client (the Struts 2 action). However a based on the header or
content of the result it should also be placed on other JMS queues.
This is the snippet I have in my concept so far:
from("test-jms:queue:test.queue")
.beanRef("tradingService", "trade")
.choice()
.when(header("source").isEqualTo("source2"))
.to("test-jms:queue:some.other.queue4")
.end();
The problem is that the client does not receive a response. It seems to
wait until the message placed on some.other.queue4 is consumed. Then
lots of "Future timed out" exceptions are thrown.
In your previous reply you mention placing onto a named queue/setting
the replyTo header rather than a temp queue. If I did this I would have
to start correlating messages back to the correct client, which I don't
think I could do if I was going through a Spring remoting proxy.
I have found that my own headers set on the original message are not
maintained along the whole route. Am I responsible for passing them
along the route myself, or can I say that a header going in to
TradingService should also be an outheader without copying it manually?
Thanks,
Martin