You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Alex Soto <al...@envieta.com> on 2020/08/18 13:21:59 UTC

How to configure shutdown timeout

Hello, 

Using Camel 3.4.0, in my unit test, I am trying to configure the shutdown timeout doing the following:
        
   public class MyTest extends CamelTestSupport {
		. . . 

	@Override
	protected CamelContext createCamelContext() throws Exception {
		CamelContext result = super.createCamelContext();

		result.getExecutorServiceManager().setShutdownAwaitTermination(30_000);
		result.getShutdownStrategy().setTimeout(60);

		return result;
	}


However,  I still see the default timeout of 10 seconds in the logs:

2020-08-17 20:58:16,726 [main] INFO  org.apache.camel.impl.engine.DefaultShutdownStrategy  - Starting to graceful shutdown 1 routes (timeout 10 seconds)

Any idea how to properly configure the shutdown timeout?

Also, I would like to know how  to do it with Blueprint XML


Best regards,
Alex soto





Re: Re: How to configure shutdown timeout

Posted by Martin Lichtin <li...@yahoo.com.INVALID>.
 � <bean id="camelShutdownStrategy" class="org.apache.camel.impl.DefaultShutdownStrategy">
 ��� <property name="timeout" value="5" />
 � </bean>

On 19.08.2020 16:01, Alex Soto wrote:
> Thanks Alex,
>
> Also looking for a way to configure this in a Blueprint XML file.
>
>
> Best regards,
> Alex soto
>
>
>
>
>> On Aug 18, 2020, at 11:13 AM, Alex Dettinger <al...@gmail.com> wrote:
>>
>> Hi Alex,
>>
>>   It seems the timeout is tuned after the context creation. One may achieve
>> the desired result with either:
>> @Override
>> protected void doPostSetup() throws Exception {
>>   context.getShutdownStrategy().setTimeout(60);
>> }
>> OR MAYBE
>> @Override
>> protected int getShutdowntimeout() {
>>   return 60;
>> }
>>
>> hth,
>> Alex
>>
>>
>>
>> On Tue, Aug 18, 2020 at 3:23 PM Alex Soto <al...@envieta.com> wrote:
>>
>>> Hello,
>>>
>>> Using Camel 3.4.0, in my unit test, I am trying to configure the shutdown
>>> timeout doing the following:
>>>
>>>    public class MyTest extends CamelTestSupport {
>>>                 . . .
>>>
>>>         @Override
>>>         protected CamelContext createCamelContext() throws Exception {
>>>                 CamelContext result = super.createCamelContext();
>>>
>>>
>>> result.getExecutorServiceManager().setShutdownAwaitTermination(30_000);
>>>                 result.getShutdownStrategy().setTimeout(60);
>>>
>>>                 return result;
>>>         }
>>>
>>>
>>> However,  I still see the default timeout of 10 seconds in the logs:
>>>
>>> 2020-08-17 20:58:16,726 [main] INFO
>>> org.apache.camel.impl.engine.DefaultShutdownStrategy  - Starting to
>>> graceful shutdown 1 routes (timeout 10 seconds)
>>>
>>> Any idea how to properly configure the shutdown timeout?
>>>
>>> Also, I would like to know how  to do it with Blueprint XML
>>>
>>>
>>> Best regards,
>>> Alex soto
>>>
>>>
>>>
>>>
>>>
>

Re: How to configure shutdown timeout

Posted by Alex Soto <al...@envieta.com>.
Thanks Alex,

Also looking for a way to configure this in a Blueprint XML file.


Best regards,
Alex soto




> On Aug 18, 2020, at 11:13 AM, Alex Dettinger <al...@gmail.com> wrote:
> 
> Hi Alex,
> 
>  It seems the timeout is tuned after the context creation. One may achieve
> the desired result with either:
> @Override
> protected void doPostSetup() throws Exception {
>  context.getShutdownStrategy().setTimeout(60);
> }
> OR MAYBE
> @Override
> protected int getShutdowntimeout() {
>  return 60;
> }
> 
> hth,
> Alex
> 
> 
> 
> On Tue, Aug 18, 2020 at 3:23 PM Alex Soto <al...@envieta.com> wrote:
> 
>> Hello,
>> 
>> Using Camel 3.4.0, in my unit test, I am trying to configure the shutdown
>> timeout doing the following:
>> 
>>   public class MyTest extends CamelTestSupport {
>>                . . .
>> 
>>        @Override
>>        protected CamelContext createCamelContext() throws Exception {
>>                CamelContext result = super.createCamelContext();
>> 
>> 
>> result.getExecutorServiceManager().setShutdownAwaitTermination(30_000);
>>                result.getShutdownStrategy().setTimeout(60);
>> 
>>                return result;
>>        }
>> 
>> 
>> However,  I still see the default timeout of 10 seconds in the logs:
>> 
>> 2020-08-17 20:58:16,726 [main] INFO
>> org.apache.camel.impl.engine.DefaultShutdownStrategy  - Starting to
>> graceful shutdown 1 routes (timeout 10 seconds)
>> 
>> Any idea how to properly configure the shutdown timeout?
>> 
>> Also, I would like to know how  to do it with Blueprint XML
>> 
>> 
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>> 
>> 


Re: How to configure shutdown timeout

Posted by Alex Dettinger <al...@gmail.com>.
Hi Alex,

  It seems the timeout is tuned after the context creation. One may achieve
the desired result with either:
@Override
protected void doPostSetup() throws Exception {
  context.getShutdownStrategy().setTimeout(60);
}
OR MAYBE
@Override
protected int getShutdowntimeout() {
  return 60;
}

hth,
Alex



On Tue, Aug 18, 2020 at 3:23 PM Alex Soto <al...@envieta.com> wrote:

> Hello,
>
> Using Camel 3.4.0, in my unit test, I am trying to configure the shutdown
> timeout doing the following:
>
>    public class MyTest extends CamelTestSupport {
>                 . . .
>
>         @Override
>         protected CamelContext createCamelContext() throws Exception {
>                 CamelContext result = super.createCamelContext();
>
>
> result.getExecutorServiceManager().setShutdownAwaitTermination(30_000);
>                 result.getShutdownStrategy().setTimeout(60);
>
>                 return result;
>         }
>
>
> However,  I still see the default timeout of 10 seconds in the logs:
>
> 2020-08-17 20:58:16,726 [main] INFO
> org.apache.camel.impl.engine.DefaultShutdownStrategy  - Starting to
> graceful shutdown 1 routes (timeout 10 seconds)
>
> Any idea how to properly configure the shutdown timeout?
>
> Also, I would like to know how  to do it with Blueprint XML
>
>
> Best regards,
> Alex soto
>
>
>
>
>