There are a lot of technologies here that I've never used so maybe I'm saying a lot o stupid things :P... sorry
Anyway, the message can be something similar to this (not exactly this one because I'm still working on this and I've still to decide what to send):
I want for example split this message in 4 different messages to be sent to 4 different services. (for now I've 2 REST services and two SOAP )
one of them should be blocking ( the one that validate the token ).
In case the response is negative I've to follow another route.
The 3 other can be parallel but I need at the end to aggregate all the data in only one response to client.
This is more or less the full scenario.
Edited by: allanon76 on Jan 20, 2011 10:28 AM
Its a bit like the Composed Message Processor
Or the Scatter-Gatter
In Camel the Splitter has a build in Aggregator, so that's fairly simple. Just provide it with an AggregationStrategy, and implement the "merge" logic there.
If you want to understand these patterns in more depth then consider the Camel in Action book. Chapter 8 covers the splitter, aggregator very deeply.
Its in print so you can find it any any of the major web bookstores.
thanks for the suggestion.
This is what I've done
the problem with this is that using multicast send to all endpoints the same message.
For this reason I used interceptors
interceptSendToEndpoint("http://host:7890/*").process(new DumpBody("INTERCEPTED TO OQSI"));
interceptSendToEndpoint("http://host/*").process(new DumpBody("INTERCEPTED TO l3s"));
to manipulate the exchange before sending it to the final service.
The problem is that it seems only one endpoint receive the correct message, to the second one the body of the exchange is empty.... how it is possible?
The DumpBody processor just write in the log the body of the exchange and what I've is
in one case
DumpBody | com.els.os.camel.DumpBody 23 | 234 - camel - 0.0.1.SNAPSHOT | INTERCEPTED TO OQSI <++++++> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:open="http://opens
and in second case the DUMP as an empty body
DumpBody | com.els.os.camel.DumpBody 23 | 234 - camel - 0.0.1.SNAPSHOT | INTERCEPTED TO l3s <++++++>
Where I'm wrong?
the multicast works now.