You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Bill <ch...@gmail.com> on 2011/06/21 09:21:10 UTC

something confused about using EventNotifierSupport to record time costs

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)
event;
			Exchange exchange = exchangeCompletedEvent.getExchange();
			Date created = ((ExchangeCompletedEvent) event).getExchange()
					.getProperty(Exchange.CREATED_TIMESTAMP, Date.class);
			
			exchange.getContext().getName();
			Date now = new Date();
			long elapsed = now.getTime() - created.getTime();
			//....................................

		}
	}


but when the route is mutilcast:

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


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: http://camel.465427.n5.nabble.com/something-confused-about-using-EventNotifierSupport-to-record-time-costs-tp4509605p4509605.html
Sent from the Camel - Users mailing list archive at Nabble.com.