You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Chris Melikian <ch...@melikian.net> on 2015/04/24 14:38:24 UTC

Access inflight repository on shutdown?

Hi,

I'd like to be able to at least dump each inflight exchange to the log when
a shutdown occurs using Camel 2.15.1.

How can I hook my code into Camel in order to achieve this?

Best regards, Chris.



--
View this message in context: http://camel.465427.n5.nabble.com/Access-inflight-repository-on-shutdown-tp5766297.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Access inflight repository on shutdown?

Posted by udaykumarjonna <uj...@csc.com>.
Hi ,

 i have specific requirement as you were looking ,can u please paste the
code  which worked for you 

Thanks 
Uday   



--
View this message in context: http://camel.465427.n5.nabble.com/Access-inflight-repository-on-shutdown-tp5766297p5768492.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Access inflight repository on shutdown?

Posted by Chris Melikian <ch...@melikian.net>.
Worked perfectly, thanks! I didn't know about the eventing system in Camel.
It's very useful!



--
View this message in context: http://camel.465427.n5.nabble.com/Access-inflight-repository-on-shutdown-tp5766297p5766306.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Access inflight repository on shutdown?

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

You can look at
http://camel.apache.org/eventnotifier-to-log-details-about-all-sent-exchanges.html

On Fri, Apr 24, 2015 at 4:44 PM, Chris Melikian <ch...@melikian.net> wrote:
> Thanks Claus, which event notification?
>
> Do you mean via adding a LifeCycleStrategy and implementing the
> onContextStop() method? I couldn't get that working how I wanted it. My
> command-line app runs as a Windows service using the Tanuki Wrapper for
> Java. When the service is stopped and my application is ended I get some
> inflight messages that I'd like more insight into.
>
> When using the LifeCycleStrategy my method only gets called once the
> exchanges and routes have already been stopped.
>
> Any ideas?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Access-inflight-repository-on-shutdown-tp5766297p5766304.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Access inflight repository on shutdown?

Posted by Chris Melikian <ch...@melikian.net>.
Thanks Claus, which event notification? 

Do you mean via adding a LifeCycleStrategy and implementing the
onContextStop() method? I couldn't get that working how I wanted it. My
command-line app runs as a Windows service using the Tanuki Wrapper for
Java. When the service is stopped and my application is ended I get some
inflight messages that I'd like more insight into.

When using the LifeCycleStrategy my method only gets called once the
exchanges and routes have already been stopped.

Any ideas? 



--
View this message in context: http://camel.465427.n5.nabble.com/Access-inflight-repository-on-shutdown-tp5766297p5766304.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Access inflight repository on shutdown?

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

You can use the event notification and listen for when camel is
stopping and then access the registry and dump its data

On Fri, Apr 24, 2015 at 2:38 PM, Chris Melikian <ch...@melikian.net> wrote:
> Hi,
>
> I'd like to be able to at least dump each inflight exchange to the log when
> a shutdown occurs using Camel 2.15.1.
>
> How can I hook my code into Camel in order to achieve this?
>
> Best regards, Chris.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Access-inflight-repository-on-shutdown-tp5766297.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/