You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Camel Guy <ca...@devguy.com> on 2014/05/29 19:12:51 UTC
Self-termination of a Camel program
Hello again fellow riders,
I would like to my camel program to terminate shortly after the camel
context stops.
I know how to stop a camel context in a background thread. I have indeed
verified that no routes are running via jconsole. etc.
When using the Maven camel-exec plugin, apparently the process must be
killed (via, say, sigint) even after the camel context stops.
It appears that I need to write my own Java class (e.g. with static main)
that starts the context and polls context.getStatus to determine when to
exit. I wanted to double check first. I know this topic has been discussed
many times before but obviously I didn't find an answer in the search
results. Perhaps someone has a better suggestion.
Thank you,
cg
Re: Self-termination of a Camel program
Posted by Camel Guy <ca...@devguy.com>.
Thanks Matt. I believe I do that myself too. Do you poll
context.getStatus.isStopped ?
~cg
On Thu, May 29, 2014 at 10:22 AM, Matt Payne <Pa...@mattpayne.org> wrote:
> I have this working using
>
> org.apache.camel.main.Main
>
> I can send an example after work. My guess is that someone will send an
> example before that.
>
> --Matt Payne
>
>
> On Thu, May 29, 2014 at 12:12 PM, Camel Guy <ca...@devguy.com> wrote:
>
> > Hello again fellow riders,
> >
> > I would like to my camel program to terminate shortly after the camel
> > context stops.
> >
> > I know how to stop a camel context in a background thread. I have indeed
> > verified that no routes are running via jconsole. etc.
> >
> > When using the Maven camel-exec plugin, apparently the process must be
> > killed (via, say, sigint) even after the camel context stops.
> >
> > It appears that I need to write my own Java class (e.g. with static main)
> > that starts the context and polls context.getStatus to determine when to
> > exit. I wanted to double check first. I know this topic has been
> discussed
> > many times before but obviously I didn't find an answer in the search
> > results. Perhaps someone has a better suggestion.
> >
> >
> > Thank you,
> > cg
> >
>
>
>
> --
> --Matt Payne
>
Re: Self-termination of a Camel program
Posted by Matt Payne <Pa...@MattPayne.org>.
I have this working using
org.apache.camel.main.Main
I can send an example after work. My guess is that someone will send an
example before that.
--Matt Payne
On Thu, May 29, 2014 at 12:12 PM, Camel Guy <ca...@devguy.com> wrote:
> Hello again fellow riders,
>
> I would like to my camel program to terminate shortly after the camel
> context stops.
>
> I know how to stop a camel context in a background thread. I have indeed
> verified that no routes are running via jconsole. etc.
>
> When using the Maven camel-exec plugin, apparently the process must be
> killed (via, say, sigint) even after the camel context stops.
>
> It appears that I need to write my own Java class (e.g. with static main)
> that starts the context and polls context.getStatus to determine when to
> exit. I wanted to double check first. I know this topic has been discussed
> many times before but obviously I didn't find an answer in the search
> results. Perhaps someone has a better suggestion.
>
>
> Thank you,
> cg
>
--
--Matt Payne