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/03/01 10:04:41 UTC

Use EventNotifierSupport record time is not exactly

Hi,
I want to record the time costs per route. and extends EventNotifierSupport
: 
------------------------notify()----------------------
ExchangeSentEvent sent = (ExchangeSentEvent) event;
sent.getTimeTaken()
-----------------------------------------------------

but it seems just record the last Endpoint time costs;


-------------------MyRoute-------------------
		<camel:route>
			<camel:from uri="jms:queue1" />
			<camel:transacted />
			<camel:bean beanType="com.bean.BeanA"></camel:bean>
			<camel:to uri="jms:queue2" />
		</camel:route>
------------------------------------------------
in BeanA.java , I use Thread.sleep(5000);
but the print is like:
             Endpoint[jms://queue2] costs 14 ms.


-- 
View this message in context: http://camel.465427.n5.nabble.com/Use-EventNotifierSupport-record-time-is-not-exactly-tp3404610p3404610.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Use EventNotifierSupport record time is not exactly

Posted by Bill <ch...@gmail.com>.
Hi,Thanks your reply. I made it

-- 
View this message in context: http://camel.465427.n5.nabble.com/Use-EventNotifierSupport-record-time-is-not-exactly-tp3404610p3405973.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Use EventNotifierSupport record time is not exactly

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

The ExchangSentEvent is fired every time a producer sends a message
somewhere (eg in every .to in the route).

If you need the total time then check out Charles blog post on this matter
http://cmoulliard.blogspot.com/2011/02/measure-elapsed-time-with-camel.html


On Tue, Mar 1, 2011 at 10:04 AM, Bill <ch...@gmail.com> wrote:
> Hi,
> I want to record the time costs per route. and extends EventNotifierSupport
> :
> ------------------------notify()----------------------
> ExchangeSentEvent sent = (ExchangeSentEvent) event;
> sent.getTimeTaken()
> -----------------------------------------------------
>
> but it seems just record the last Endpoint time costs;
>
>
> -------------------MyRoute-------------------
>                <camel:route>
>                        <camel:from uri="jms:queue1" />
>                        <camel:transacted />
>                        <camel:bean beanType="com.bean.BeanA"></camel:bean>
>                        <camel:to uri="jms:queue2" />
>                </camel:route>
> ------------------------------------------------
> in BeanA.java , I use Thread.sleep(5000);
> but the print is like:
>             Endpoint[jms://queue2] costs 14 ms.
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Use-EventNotifierSupport-record-time-is-not-exactly-tp3404610p3404610.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/