camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill <>
Subject something confused about using EventNotifierSupport to record time costs
Date Tue, 21 Jun 2011 07:21:10 GMT
Hi, guys
I use EventNotifierSupport to record route's time cost (camel2.6).

and the code like this:
	public void notify(EventObject event) throws Exception {

		if (event instanceof ExchangeCompletedEvent) {
			ExchangeCompletedEvent exchangeCompletedEvent = (ExchangeCompletedEvent)
			Exchange exchange = exchangeCompletedEvent.getExchange();
			Date created = ((ExchangeCompletedEvent) event).getExchange()
					.getProperty(Exchange.CREATED_TIMESTAMP, Date.class);
			Date now = new Date();
			long elapsed = now.getTime() - created.getTime();


but when the route is mutilcast:

					<camel:to uri="CRMJMS:uqu2" />
					<camel:to uri="CRMJMS:uqu3" />

it will recode three times,
1 is when the exchange after uqu2
2 is when the exchange after uqu3
3 is when the exchange complete the whole route
but i can not different from 2 and 3, and the time cost between 2 and 3 is
the same.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message