Hi, 
I am using recipientList to send a message to a list of endpoints (mostly
FTP).
I am using an AggregationStrategy to compute few properties of the
exchanges:
- delivered
- how many retries
- time taken

I've been able to get 'delivered' and 'how many retries' for each endpoint
but I can't find a way to get the time it took to send the message.

I've tried to use an interceptor and store 'start-time' in the header and
then check the timestamp when the exchange hits the aggregation strategy but
this is not working as all exchanges are sent to the aggregationstrategy as
soon as the last endpoint is processed.

Do you have any suggestion on how I could get the transfer time for each
exchange?

I am using Camel 2.2

route sample:

//INTERCEPTOR
interceptSendToEndpoint("(ftp|direct|smtp):.*").process(new Processor() {
// in start-time header we store the time in which the message is sent to
the endpoint                            
  public void process(Exchange exchange) throws Exception {
    long currentTime = System.currentTimeMillis();
    exchange.getIn().setHeader("start-time", currentTime );                     
                        
  }
});

//ROUTE
from("jms-test:queue:test.queue").process(processor)                            
                                                                
.onException(Exception.class).maximumRedeliveries(2).redeliverDelay(60L).end()
.recipientList(header("recipientListHeader").tokenize(","))                     
                        
.parallelProcessing().executorService(customThreadPoolExecutor)
.aggregationStrategy(new RecipientAggregationStrategy(deliveryEndpoints,
_endpointDeliveredBaseUri))
.to("direct:chunk.completed");

thanks
-- 
View this message in context: 
http://old.nabble.com/recipientList-%2B-AggregationStrategy-tp27305176p27305176.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to