I am using multicast and have implemented AggregationStrategy java class
which implements the TimeoutAwareAggregationStrategy interface.

In the:

   public Exchange aggregate(Exchange oldExchange, Exchange newExchange)
method I am grabbing the body of the newExchange and adding it to a list.  I
then add a property that references the list.  During the next execution of 
aggregate(Exchange oldExchange, Exchange newExchange) I get the property
(list) from the oldExchange and add the body from the newExchange to the
list.

public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
                LOGGER.debug("ENTER::::AggregateCpfPrdsImpl>aggregate");
                if (oldExchange == null) {
                        List<Document> responses = new ArrayList<Document>();
                        Object oBody = 
newExchange.getIn().getBody(Document.class);
                        Document response = (Document) oBody;           
                        response.normalizeDocument(); 
                        responses.add(response);
                        newExchange.setProperty(RESPONSES, responses);
                        LOGGER.info("EXCHANGE-newExchange " + 
newExchange.toString());
                        logResponse("AggregationStrategy first response:  ", 
response);
                }
                else {

                        List<Document> responses = (List<Document>)
oldExchange.getProperty(RESPONSES);
                        Object oBody = 
newExchange.getIn().getBody(Document.class);
                        Document response = (Document) oBody;           
                        response.normalizeDocument(); 
                        responses.add(response);
                        newExchange.setProperty(RESPONSES, responses);
                        LOGGER.info("oldExhange " + oldExchange.toString());
                        LOGGER.info("newExhange " + newExchange.toString());
                        logResponse("AggregationStrategy second response:  ", 
response);
                }
                return newExchange;

The problem I face is when there is a timeout condition the exchange object
in my camel route after the multicast doesn't have the RESPONSES property
(list).  If I don't face the timeout, then the exchange object has the
RESPONSES property.

Any help would be appreciated.





--
View this message in context: 
http://camel.465427.n5.nabble.com/Multicast-Timeout-tp5804638.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to