You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Narita Bagchi <Na...@headstrong.com> on 2012/02/23 15:21:05 UTC

OnException - Stopping context

What is the right way of stopping the context, onException occurrence ?

I have tried the following -

1)        handled(true).end();

2)        continued(false).end();

3)        handled(true).stop();

None of the above seems to be working.

Thanks.
Narita

________________________________
***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***

Re: OnException - Stopping context

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Feb 23, 2012 at 3:45 PM, Narita Bagchi
<Na...@headstrong.com> wrote:
> So I will be having to call stop() on the CamelContext, onException... Right?
>

Yes. Just stop CamelContext instead of the route as shown in an example here
http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html


> Thanks.
> Regards,
> Narita
>
> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: Thursday, February 23, 2012 8:09 PM
> To: users@camel.apache.org
> Subject: Re: OnException - Stopping context
>
> On Thu, Feb 23, 2012 at 3:36 PM, Narita Bagchi <Na...@headstrong.com> wrote:
>> I understand that is the ideal way of stopping the CamelContext in normal scenario. Should I be opting the same approach along with, OnException clause?
>>
>> http://camel.apache.org/exception-clause.html link somewhere says - "
>> If handled is true, then the thrown exception will be handled and Camel will not continue routing in the original route, but break out."
>> What is meant by this, then?
>
> Its stopping the *current* message from being continued to be routed.
> CamelContext will still be running.
>
>>
>> I am basically trying to stop the CamelContext on the event of an Exception.
>>
>
> This is different. Stopping CamelContext essentially mean stop Camel itself.
>
>
>> Thanks.
>> Regards,
>> Narita
>>
>> -----Original Message-----
>> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
>> Sent: Thursday, February 23, 2012 8:00 PM
>> To: users@camel.apache.org
>> Subject: Re: OnException - Stopping context
>>
>> On Thu, Feb 23, 2012 at 3:28 PM, Narita Bagchi <Na...@headstrong.com> wrote:
>>> I want to stop the CamelContext.
>>>
>>
>> Then you have to call stop() on the CamelContext.
>>
>> And mind that it will use graceful shutdown, so read this FAQ
>> http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html
>>
>>> Thanks.
>>> Regards,
>>> Narita
>>>
>>> -----Original Message-----
>>> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
>>> Sent: Thursday, February 23, 2012 7:55 PM
>>> To: users@camel.apache.org
>>> Subject: Re: OnException - Stopping context
>>>
>>> On Thu, Feb 23, 2012 at 3:21 PM, Narita Bagchi <Na...@headstrong.com> wrote:
>>>> What is the right way of stopping the context, onException occurrence ?
>>>>
>>>> I have tried the following -
>>>>
>>>> 1)        handled(true).end();
>>>>
>>>> 2)        continued(false).end();
>>>>
>>>> 3)        handled(true).stop();
>>>>
>>>> None of the above seems to be working.
>>>>
>>>
>>> What do you want to stop?
>>>
>>>
>>>
>>>> Thanks.
>>>> Narita
>>>>
>>>> ________________________________
>>>> ***The information transmitted is intended only for the person or
>>>> entity to which it is addressed and may contain confidential and/or
>>>> privileged material. Any review,retransmission,dissemination or
>>>> other use of, or taking of any action in reliance upon, this
>>>> information by persons or entities other than the intended recipient is prohibited.
>>>> If you received this in error, please contact the sender and delete
>>>> the material from any computer.***
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> -----------------
>>> FuseSource
>>> Email: cibsen@fusesource.com
>>> Web: http://fusesource.com
>>> Twitter: davsclaus, fusenews
>>> Blog: http://davsclaus.blogspot.com/
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>
>>> ***The information transmitted is intended only for the person or
>>> entity to which it is addressed and may contain confidential and/or
>>> privileged material. Any review,retransmission,dissemination or other
>>> use of, or taking of any action in reliance upon, this information by
>>> persons or entities other than the intended recipient is prohibited.
>>> If you received this in error, please contact the sender and delete
>>> the material from any computer.***
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> FuseSource
>> Email: cibsen@fusesource.com
>> Web: http://fusesource.com
>> Twitter: davsclaus, fusenews
>> Blog: http://davsclaus.blogspot.com/
>> Author of Camel in Action: http://www.manning.com/ibsen/
>>
>> ***The information transmitted is intended only for the person or
>> entity to which it is addressed and may contain confidential and/or
>> privileged material. Any review,retransmission,dissemination or other
>> use of, or taking of any action in reliance upon, this information by
>> persons or entities other than the intended recipient is prohibited.
>> If you received this in error, please contact the sender and delete
>> the material from any computer.***
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>
> ***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***



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

RE: OnException - Stopping context

Posted by Narita Bagchi <Na...@headstrong.com>.
So I will be having to call stop() on the CamelContext, onException... Right?

Thanks.
Regards,
Narita

-----Original Message-----
From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
Sent: Thursday, February 23, 2012 8:09 PM
To: users@camel.apache.org
Subject: Re: OnException - Stopping context

On Thu, Feb 23, 2012 at 3:36 PM, Narita Bagchi <Na...@headstrong.com> wrote:
> I understand that is the ideal way of stopping the CamelContext in normal scenario. Should I be opting the same approach along with, OnException clause?
>
> http://camel.apache.org/exception-clause.html link somewhere says - "
> If handled is true, then the thrown exception will be handled and Camel will not continue routing in the original route, but break out."
> What is meant by this, then?

Its stopping the *current* message from being continued to be routed.
CamelContext will still be running.

>
> I am basically trying to stop the CamelContext on the event of an Exception.
>

This is different. Stopping CamelContext essentially mean stop Camel itself.


> Thanks.
> Regards,
> Narita
>
> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: Thursday, February 23, 2012 8:00 PM
> To: users@camel.apache.org
> Subject: Re: OnException - Stopping context
>
> On Thu, Feb 23, 2012 at 3:28 PM, Narita Bagchi <Na...@headstrong.com> wrote:
>> I want to stop the CamelContext.
>>
>
> Then you have to call stop() on the CamelContext.
>
> And mind that it will use graceful shutdown, so read this FAQ
> http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html
>
>> Thanks.
>> Regards,
>> Narita
>>
>> -----Original Message-----
>> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
>> Sent: Thursday, February 23, 2012 7:55 PM
>> To: users@camel.apache.org
>> Subject: Re: OnException - Stopping context
>>
>> On Thu, Feb 23, 2012 at 3:21 PM, Narita Bagchi <Na...@headstrong.com> wrote:
>>> What is the right way of stopping the context, onException occurrence ?
>>>
>>> I have tried the following -
>>>
>>> 1)        handled(true).end();
>>>
>>> 2)        continued(false).end();
>>>
>>> 3)        handled(true).stop();
>>>
>>> None of the above seems to be working.
>>>
>>
>> What do you want to stop?
>>
>>
>>
>>> Thanks.
>>> Narita
>>>
>>> ________________________________
>>> ***The information transmitted is intended only for the person or
>>> entity to which it is addressed and may contain confidential and/or
>>> privileged material. Any review,retransmission,dissemination or
>>> other use of, or taking of any action in reliance upon, this
>>> information by persons or entities other than the intended recipient is prohibited.
>>> If you received this in error, please contact the sender and delete
>>> the material from any computer.***
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> FuseSource
>> Email: cibsen@fusesource.com
>> Web: http://fusesource.com
>> Twitter: davsclaus, fusenews
>> Blog: http://davsclaus.blogspot.com/
>> Author of Camel in Action: http://www.manning.com/ibsen/
>>
>> ***The information transmitted is intended only for the person or
>> entity to which it is addressed and may contain confidential and/or
>> privileged material. Any review,retransmission,dissemination or other
>> use of, or taking of any action in reliance upon, this information by
>> persons or entities other than the intended recipient is prohibited.
>> If you received this in error, please contact the sender and delete
>> the material from any computer.***
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>
> ***The information transmitted is intended only for the person or
> entity to which it is addressed and may contain confidential and/or
> privileged material. Any review,retransmission,dissemination or other
> use of, or taking of any action in reliance upon, this information by
> persons or entities other than the intended recipient is prohibited.
> If you received this in error, please contact the sender and delete
> the material from any computer.***



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

***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***

Re: OnException - Stopping context

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Feb 23, 2012 at 3:36 PM, Narita Bagchi
<Na...@headstrong.com> wrote:
> I understand that is the ideal way of stopping the CamelContext in normal scenario. Should I be opting the same approach along with, OnException clause?
>
> http://camel.apache.org/exception-clause.html link somewhere says -
> " If handled is true, then the thrown exception will be handled and Camel will not continue routing in the original route, but break out."
> What is meant by this, then?

Its stopping the *current* message from being continued to be routed.
CamelContext will still be running.

>
> I am basically trying to stop the CamelContext on the event of an Exception.
>

This is different. Stopping CamelContext essentially mean stop Camel itself.


> Thanks.
> Regards,
> Narita
>
> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: Thursday, February 23, 2012 8:00 PM
> To: users@camel.apache.org
> Subject: Re: OnException - Stopping context
>
> On Thu, Feb 23, 2012 at 3:28 PM, Narita Bagchi <Na...@headstrong.com> wrote:
>> I want to stop the CamelContext.
>>
>
> Then you have to call stop() on the CamelContext.
>
> And mind that it will use graceful shutdown, so read this FAQ http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html
>
>> Thanks.
>> Regards,
>> Narita
>>
>> -----Original Message-----
>> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
>> Sent: Thursday, February 23, 2012 7:55 PM
>> To: users@camel.apache.org
>> Subject: Re: OnException - Stopping context
>>
>> On Thu, Feb 23, 2012 at 3:21 PM, Narita Bagchi <Na...@headstrong.com> wrote:
>>> What is the right way of stopping the context, onException occurrence ?
>>>
>>> I have tried the following -
>>>
>>> 1)        handled(true).end();
>>>
>>> 2)        continued(false).end();
>>>
>>> 3)        handled(true).stop();
>>>
>>> None of the above seems to be working.
>>>
>>
>> What do you want to stop?
>>
>>
>>
>>> Thanks.
>>> Narita
>>>
>>> ________________________________
>>> ***The information transmitted is intended only for the person or
>>> entity to which it is addressed and may contain confidential and/or
>>> privileged material. Any review,retransmission,dissemination or other
>>> use of, or taking of any action in reliance upon, this information by
>>> persons or entities other than the intended recipient is prohibited.
>>> If you received this in error, please contact the sender and delete
>>> the material from any computer.***
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> FuseSource
>> Email: cibsen@fusesource.com
>> Web: http://fusesource.com
>> Twitter: davsclaus, fusenews
>> Blog: http://davsclaus.blogspot.com/
>> Author of Camel in Action: http://www.manning.com/ibsen/
>>
>> ***The information transmitted is intended only for the person or
>> entity to which it is addressed and may contain confidential and/or
>> privileged material. Any review,retransmission,dissemination or other
>> use of, or taking of any action in reliance upon, this information by
>> persons or entities other than the intended recipient is prohibited.
>> If you received this in error, please contact the sender and delete
>> the material from any computer.***
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>
> ***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***



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

RE: OnException - Stopping context

Posted by Narita Bagchi <Na...@headstrong.com>.
I understand that is the ideal way of stopping the CamelContext in normal scenario. Should I be opting the same approach along with, OnException clause?

http://camel.apache.org/exception-clause.html link somewhere says -
" If handled is true, then the thrown exception will be handled and Camel will not continue routing in the original route, but break out."
What is meant by this, then?

I am basically trying to stop the CamelContext on the event of an Exception.

Thanks.
Regards,
Narita

-----Original Message-----
From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
Sent: Thursday, February 23, 2012 8:00 PM
To: users@camel.apache.org
Subject: Re: OnException - Stopping context

On Thu, Feb 23, 2012 at 3:28 PM, Narita Bagchi <Na...@headstrong.com> wrote:
> I want to stop the CamelContext.
>

Then you have to call stop() on the CamelContext.

And mind that it will use graceful shutdown, so read this FAQ http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html

> Thanks.
> Regards,
> Narita
>
> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: Thursday, February 23, 2012 7:55 PM
> To: users@camel.apache.org
> Subject: Re: OnException - Stopping context
>
> On Thu, Feb 23, 2012 at 3:21 PM, Narita Bagchi <Na...@headstrong.com> wrote:
>> What is the right way of stopping the context, onException occurrence ?
>>
>> I have tried the following -
>>
>> 1)        handled(true).end();
>>
>> 2)        continued(false).end();
>>
>> 3)        handled(true).stop();
>>
>> None of the above seems to be working.
>>
>
> What do you want to stop?
>
>
>
>> Thanks.
>> Narita
>>
>> ________________________________
>> ***The information transmitted is intended only for the person or
>> entity to which it is addressed and may contain confidential and/or
>> privileged material. Any review,retransmission,dissemination or other
>> use of, or taking of any action in reliance upon, this information by
>> persons or entities other than the intended recipient is prohibited.
>> If you received this in error, please contact the sender and delete
>> the material from any computer.***
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>
> ***The information transmitted is intended only for the person or
> entity to which it is addressed and may contain confidential and/or
> privileged material. Any review,retransmission,dissemination or other
> use of, or taking of any action in reliance upon, this information by
> persons or entities other than the intended recipient is prohibited.
> If you received this in error, please contact the sender and delete
> the material from any computer.***



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

***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***

Re: OnException - Stopping context

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Feb 23, 2012 at 3:28 PM, Narita Bagchi
<Na...@headstrong.com> wrote:
> I want to stop the CamelContext.
>

Then you have to call stop() on the CamelContext.

And mind that it will use graceful shutdown, so read this FAQ
http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html

> Thanks.
> Regards,
> Narita
>
> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: Thursday, February 23, 2012 7:55 PM
> To: users@camel.apache.org
> Subject: Re: OnException - Stopping context
>
> On Thu, Feb 23, 2012 at 3:21 PM, Narita Bagchi <Na...@headstrong.com> wrote:
>> What is the right way of stopping the context, onException occurrence ?
>>
>> I have tried the following -
>>
>> 1)        handled(true).end();
>>
>> 2)        continued(false).end();
>>
>> 3)        handled(true).stop();
>>
>> None of the above seems to be working.
>>
>
> What do you want to stop?
>
>
>
>> Thanks.
>> Narita
>>
>> ________________________________
>> ***The information transmitted is intended only for the person or
>> entity to which it is addressed and may contain confidential and/or
>> privileged material. Any review,retransmission,dissemination or other
>> use of, or taking of any action in reliance upon, this information by
>> persons or entities other than the intended recipient is prohibited.
>> If you received this in error, please contact the sender and delete
>> the material from any computer.***
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>
> ***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***



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

RE: OnException - Stopping context

Posted by Narita Bagchi <Na...@headstrong.com>.
I want to stop the CamelContext.

Thanks.
Regards,
Narita

-----Original Message-----
From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
Sent: Thursday, February 23, 2012 7:55 PM
To: users@camel.apache.org
Subject: Re: OnException - Stopping context

On Thu, Feb 23, 2012 at 3:21 PM, Narita Bagchi <Na...@headstrong.com> wrote:
> What is the right way of stopping the context, onException occurrence ?
>
> I have tried the following -
>
> 1)        handled(true).end();
>
> 2)        continued(false).end();
>
> 3)        handled(true).stop();
>
> None of the above seems to be working.
>

What do you want to stop?



> Thanks.
> Narita
>
> ________________________________
> ***The information transmitted is intended only for the person or
> entity to which it is addressed and may contain confidential and/or
> privileged material. Any review,retransmission,dissemination or other
> use of, or taking of any action in reliance upon, this information by
> persons or entities other than the intended recipient is prohibited.
> If you received this in error, please contact the sender and delete
> the material from any computer.***



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

***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***

Re: OnException - Stopping context

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Feb 23, 2012 at 3:21 PM, Narita Bagchi
<Na...@headstrong.com> wrote:
> What is the right way of stopping the context, onException occurrence ?
>
> I have tried the following -
>
> 1)        handled(true).end();
>
> 2)        continued(false).end();
>
> 3)        handled(true).stop();
>
> None of the above seems to be working.
>

What do you want to stop?



> Thanks.
> Narita
>
> ________________________________
> ***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***



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