You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ext2 <xu...@tongtech.com> on 2010/10/13 05:20:59 UTC

Does Gracefull shutdown Mbean support waiting time argument?

Hi:
	Camel support graceful shutdown feature. When the camelContext is
stopped, camel will try to stop application gracefully until the time
expired; 

	Some-times the system manager  may required to try to stop the
application , and if the application cannot be stopped in time, the system
manager will have another chance to decide to shutdown the application
robustly or not;
	That's to say , does the camel graceful shutdown strategy support
such feature as following?

	boolean stop(Boolean robust, int waitingTime);
	if ${robust} == false, camel will try to stop application in
${waitingtime) gracefully. if ${waitingTime) expired, camel will not stop
application robustly.
	If ${robust} == true, camel will try to stop application in
${waitingTime), if ${waitingTime)expired, camel will shutdown application
robustly;

Thanks any suggestion



Re: how about robust-stop and try stop strategy support of camel while stop the application

Posted by ext2 <xu...@tongtech.com>.
I see, thanks a lot
============================================================
> Willem Jiang [mailto:willem.jiang@gmail.com] 
> 2010年10月14日 14:34
> users@camel.apache.org
>Re: how about robust-stop and try stop strategy support of camel while stop
the application

I don't think current Camel can do the job 2.
But you can easily write a customer ShutdownStrategy which extends the 
default one and configure it into Camel.

On 10/13/10 8:59 PM, ext2 wrote:
>
> Hi:
> 	I have post the question. But it seems I doesn't illustrate the
> usage clearly and cause some  confuse things. So I re-write the use case,
> and repost the subject again. I am regret for it :(.
> 	
> 	While the manager decide to stop the applications. They often
> encounter such situations;
> 	1: Sometimes , system  shutdown is urgent, and the application must
> be stopped in time. And the user want the application support some robust
> strategy to avoid lost messages at this situation;
> 	The camel's graceful-shutdown strategy support the technical
> framework to fulfil such situations; But how to achieve the robust
purpose,
> it's another question. and it's not key-point here; (Actually, it's too
hard
> to guarantee not to lost any message, even it's impossible sometimes. We
> will have a risk to lost the being processed message. So we need another
> stop strategy as following).;
>
> 	2: Sometimes, system shutdown is not urgent. and the manager has
> enough time to waiting applications to stop and the manager doesn't want
> take the risk of lost message; At such case, the manager require another
> stop strategy: just trying to stop in the give time. if time expired, it
> doesn't stop the system and just report stopping failed to tell the
manager:
> application cannot be shutdown now, it's working.
> 	And how does camel support such stop strategy ?
>
>
>


-- 
Willem
----------------------------------
Open Source Integration: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: http://twitter.com/willemjiang



Re: how about robust-stop and try stop strategy support of camel while stop the application

Posted by Willem Jiang <wi...@gmail.com>.
I don't think current Camel can do the job 2.
But you can easily write a customer ShutdownStrategy which extends the 
default one and configure it into Camel.

On 10/13/10 8:59 PM, ext2 wrote:
>
> Hi:
> 	I have post the question. But it seems I doesn't illustrate the
> usage clearly and cause some  confuse things. So I re-write the use case,
> and repost the subject again. I am regret for it :(.
> 	
> 	While the manager decide to stop the applications. They often
> encounter such situations;
> 	1: Sometimes , system  shutdown is urgent, and the application must
> be stopped in time. And the user want the application support some robust
> strategy to avoid lost messages at this situation;
> 	The camel's graceful-shutdown strategy support the technical
> framework to fulfil such situations; But how to achieve the robust purpose,
> it's another question. and it's not key-point here; (Actually, it's too hard
> to guarantee not to lost any message, even it's impossible sometimes. We
> will have a risk to lost the being processed message. So we need another
> stop strategy as following).;
>
> 	2: Sometimes, system shutdown is not urgent. and the manager has
> enough time to waiting applications to stop and the manager doesn't want
> take the risk of lost message; At such case, the manager require another
> stop strategy: just trying to stop in the give time. if time expired, it
> doesn't stop the system and just report stopping failed to tell the manager:
> application cannot be shutdown now, it's working.
> 	And how does camel support such stop strategy ?
>
>
>


-- 
Willem
----------------------------------
Open Source Integration: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: http://twitter.com/willemjiang

how about robust-stop and try stop strategy support of camel while stop the application

Posted by ext2 <xu...@tongtech.com>.
Hi:
	I have post the question. But it seems I doesn't illustrate the
usage clearly and cause some  confuse things. So I re-write the use case,
and repost the subject again. I am regret for it :(.
	
	While the manager decide to stop the applications. They often
encounter such situations;
	1: Sometimes , system  shutdown is urgent, and the application must
be stopped in time. And the user want the application support some robust
strategy to avoid lost messages at this situation;
	The camel's graceful-shutdown strategy support the technical
framework to fulfil such situations; But how to achieve the robust purpose,
it's another question. and it's not key-point here; (Actually, it's too hard
to guarantee not to lost any message, even it's impossible sometimes. We
will have a risk to lost the being processed message. So we need another
stop strategy as following).;

	2: Sometimes, system shutdown is not urgent. and the manager has
enough time to waiting applications to stop and the manager doesn't want
take the risk of lost message; At such case, the manager require another
stop strategy: just trying to stop in the give time. if time expired, it
doesn't stop the system and just report stopping failed to tell the manager:
application cannot be shutdown now, it's working.
	And how does camel support such stop strategy ? 



Re: Does Gracefull shutdown Mbean support waiting time argument?

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

I created a ticket, so we wont forget about this
https://issues.apache.org/activemq/browse/CAMEL-3240

On Thu, Oct 14, 2010 at 9:13 PM, Claus Ibsen <cl...@gmail.com> wrote:
> On Wed, Oct 13, 2010 at 12:24 PM, ext2 <xu...@tongtech.com> wrote:
>> Hi:
>>  It seems the camel's graceful shutdownis just like the requirement "robust
>> stop application":  give a waiting time, force stop, and do it's best
>> ability to avoid lost message;
>>
>> But the camel cannot support "try to stop" interface; isn't it?
>
> Fell free to create a ticket about that last requirement to give up
> (eg try to stop but give up if you could not do it after X seconds).
>
>
>
>> ======================================================
>>>Hi
>>>Can you elaborate on the robust shutdown?
>>
>>>My experience is if you can't do the grace for shutdown with a certain
>>>time, the on flight exchanges maybe have no other change to be processed.
>>
>>>Do you mean Camel should store these on flight exchanges into a
>>>persistence storage, if the wait time is out.
>>
>> No, It doesn't ask for so such process.
>>
>> From the end user(system manager)'s point, it just means camel should give
>> him chance to choose:
>> 1) robust stop the application: It means the application must be stopped
>> until the waiting-time expired;
>> 2) or just try to stop application: it means the application must not be
>> stopped if system is still busy until waiting time out.
>>
>> This function could tell the system manager: if you don't want to lost the
>> message, you can do "try to stop " again and again. But if you couldn't
>> endure and choose to robust stop ((especially the case: deadlocked by extern
>> system), then you will have a risk to lost a message.
>>
>> whether using persistence storage or other means , it 's just a different
>> ways to implement the "try to stop" requirement; For example we can use
>> another simple ways to implement the requirement:
>> Suspending the consumer's IO operation to avoid  continue to process
>> external message; and just waiting the Exchange to be processed over;  if
>> the Exchange is still being processed while time out, just return false to
>> indicate try-stop failed;
>>
>> Thanks
>>
>>
>>
>>
>>
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Does Gracefull shutdown Mbean support waiting time argument?

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Oct 13, 2010 at 12:24 PM, ext2 <xu...@tongtech.com> wrote:
> Hi:
>  It seems the camel's graceful shutdownis just like the requirement "robust
> stop application":  give a waiting time, force stop, and do it's best
> ability to avoid lost message;
>
> But the camel cannot support "try to stop" interface; isn't it?

Fell free to create a ticket about that last requirement to give up
(eg try to stop but give up if you could not do it after X seconds).



> ======================================================
>>Hi
>>Can you elaborate on the robust shutdown?
>
>>My experience is if you can't do the grace for shutdown with a certain
>>time, the on flight exchanges maybe have no other change to be processed.
>
>>Do you mean Camel should store these on flight exchanges into a
>>persistence storage, if the wait time is out.
>
> No, It doesn't ask for so such process.
>
> From the end user(system manager)'s point, it just means camel should give
> him chance to choose:
> 1) robust stop the application: It means the application must be stopped
> until the waiting-time expired;
> 2) or just try to stop application: it means the application must not be
> stopped if system is still busy until waiting time out.
>
> This function could tell the system manager: if you don't want to lost the
> message, you can do "try to stop " again and again. But if you couldn't
> endure and choose to robust stop ((especially the case: deadlocked by extern
> system), then you will have a risk to lost a message.
>
> whether using persistence storage or other means , it 's just a different
> ways to implement the "try to stop" requirement; For example we can use
> another simple ways to implement the requirement:
> Suspending the consumer's IO operation to avoid  continue to process
> external message; and just waiting the Exchange to be processed over;  if
> the Exchange is still being processed while time out, just return false to
> indicate try-stop failed;
>
> Thanks
>
>
>
>
>
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Does Gracefull shutdown Mbean support waiting time argument?

Posted by ext2 <xu...@tongtech.com>.
Hi:
  It seems the camel's graceful shutdownis just like the requirement "robust
stop application":  give a waiting time, force stop, and do it's best
ability to avoid lost message;

But the camel cannot support "try to stop" interface; isn't it?
======================================================
>Hi
>Can you elaborate on the robust shutdown?

>My experience is if you can't do the grace for shutdown with a certain 
>time, the on flight exchanges maybe have no other change to be processed.

>Do you mean Camel should store these on flight exchanges into a 
>persistence storage, if the wait time is out.

No, It doesn't ask for so such process. 

>From the end user(system manager)'s point, it just means camel should give
him chance to choose:
1) robust stop the application: It means the application must be stopped
until the waiting-time expired;
2) or just try to stop application: it means the application must not be
stopped if system is still busy until waiting time out. 

This function could tell the system manager: if you don't want to lost the
message, you can do "try to stop " again and again. But if you couldn't
endure and choose to robust stop ((especially the case: deadlocked by extern
system), then you will have a risk to lost a message.

whether using persistence storage or other means , it 's just a different
ways to implement the "try to stop" requirement; For example we can use
another simple ways to implement the requirement: 
Suspending the consumer's IO operation to avoid  continue to process
external message; and just waiting the Exchange to be processed over;  if
the Exchange is still being processed while time out, just return false to
indicate try-stop failed;

Thanks 







Re: Does Gracefull shutdown Mbean support waiting time argument?

Posted by ext2 <xu...@tongtech.com>.
>Hi
>Can you elaborate on the robust shutdown?

>My experience is if you can't do the grace for shutdown with a certain 
>time, the on flight exchanges maybe have no other change to be processed.

>Do you mean Camel should store these on flight exchanges into a 
>persistence storage, if the wait time is out.

No, It doesn't ask for so such process. 

>From the end user(system manager)'s point, it just means camel should give
him chance to choose:
1) robust stop the application: It means the application must be stopped
until the waiting-time expired;
2) or just try to stop application: it means the application must not be
stopped if system is still busy until waiting time out. 

This function could tell the system manager: if you don't want to lost the
message, you can do "try to stop " again and again. But if you couldn't
endure and choose to robust stop ((especially the case: deadlocked by extern
system), then you will have a risk to lost a message.

whether using persistence storage or other means , it 's just a different
ways to implement the "try to stop" requirement; For example we can use
another simple ways to implement the requirement: 
Suspending the consumer's IO operation to avoid  continue to process
external message; and just waiting the Exchange to be processed over;  if
the Exchange is still being processed while time out, just return false to
indicate try-stop failed;

Thanks 





Re: Does Gracefull shutdown Mbean support waiting time argument?

Posted by Willem Jiang <wi...@gmail.com>.
Hi

Can you elaborate on the robust shutdown?

My experience is if you can't do the grace for shutdown with a certain 
time, the on flight exchanges maybe have no other change to be processed.

Do you mean Camel should store these on flight exchanges into a 
persistence storage, if the wait time is out.


On 10/13/10 11:20 AM, ext2 wrote:
> Hi:
> 	Camel support graceful shutdown feature. When the camelContext is
> stopped, camel will try to stop application gracefully until the time
> expired;
>
> 	Some-times the system manager  may required to try to stop the
> application , and if the application cannot be stopped in time, the system
> manager will have another chance to decide to shutdown the application
> robustly or not;
> 	That's to say , does the camel graceful shutdown strategy support
> such feature as following?
>
> 	boolean stop(Boolean robust, int waitingTime);
> 	if ${robust} == false, camel will try to stop application in
> ${waitingtime) gracefully. if ${waitingTime) expired, camel will not stop
> application robustly.
> 	If ${robust} == true, camel will try to stop application in
> ${waitingTime), if ${waitingTime)expired, camel will shutdown application
> robustly;
>
> Thanks any suggestion
>
>
>


-- 
Willem
----------------------------------
Open Source Integration: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: http://twitter.com/willemjiang