[ 
https://issues.apache.org/jira/browse/CAMEL-8499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14364852#comment-14364852
 ] 

Antoine DESSAIGNE commented on CAMEL-8499:
------------------------------------------

Hi Claus,

We implemented this using a simple call to {{cancel(true)}} on the 
{{currentShutdownTaskFuture}} of the {{DefaultShutdownStrategy}}.
Maybe it would be better to make the {{DefaultShutdownStrategy}} truly 
stateless.
For instance we could have something like
{code}
public interface ShutdownStrategy {
    public Shutdown shutdown(CamelContext context);
}

public interface Shutdown {
    boolean isComplete();
    boolean hasTimeoutOccured();
    int getPendingMessageCount(); // refreshed every second
    int getDuration();
    boolean forceShutdown();
}
{code}

Right now the fields of a particular shutdown task are direct attributes of 
{{DefaultShutdownStrategy}}.

What do you think ?

> Graceful shutdown - Add kill operation
> --------------------------------------
>
>                 Key: CAMEL-8499
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8499
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core, jmx
>    Affects Versions: 2.15.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>             Fix For: Future
>
>
> When Camel is doing a graceful shutdown, it may take some time to shutdown to 
> drain inflight exchanges. And as that by default has a timeout of 300 seconds 
> that is counting down. Then sometimes end users dont bother, eg its a test 
> environment etc. Then we should have a JMX / Java API on graceful shutdown to 
> terminate this timeout asap. Its basically to cancel the future task to do it.
> We can then also have a karaf commands as well. Maybe its reusing the stop 
> command but with a --kill flag.
> If kill is a too extreme wording, we could use force stop or something 
> instead.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to