[ 
https://issues.apache.org/jira/browse/CAMEL-16581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rastislav Papp updated CAMEL-16581:
-----------------------------------
    Description: 
camel-quartz provides option {{interruptJobsOnShutdown}}, which says the 
running jobs will be interrupted. 
{{org.apache.camel.component.quartz.CamelJob}} does not implement 
{{org.quartz.InterruptableJob}} though, so when shutting down the scheduler, 
the running jobs in fact will *not* be interrupted, as per implementation of 
{{org.quartz.core.QuartzScheduler#shutdown(boolean)}}: 
{code:java}
...
if(job.getJobInstance() instanceof InterruptableJob)
    try {
        ((InterruptableJob)job.getJobInstance()).interrupt();
    }
    ...
...
{code}

The job thread stays running, and does not get any information about the 
scheduler shutdown.

Also, if it worked, I would like to be able to configure the behavior in 
quartz.properties (which I supply to {{QuartzComponent}}), as opposed to 
configuring it on the {{QuartzComponent}} itself. 
At this moment, it is needed to supply the {{interruptJobsOnShutdown}} to the 
{{QuartzComponent}}, even if my {{quartz.properties}} already contains 
{{org.quartz.scheduler.interruptJobsOnShutdown=true}}.

  was:
camel-quartz provides option {{interruptJobsOnShutdown}}, which says the 
running jobs will be interrupted. 
{{org.apache.camel.component.quartz.CamelJob}} does not implement 
{{org.quartz.InterruptableJob}} though, so when shutting down the scheduler, 
the running jobs in fact will *not* be interrupted, as per implementation of 
{{org.quartz.core.QuartzScheduler#shutdown(boolean)}}: 
{code:java}
...
if(job.getJobInstance() instanceof InterruptableJob)
    try {
        ((InterruptableJob)job.getJobInstance()).interrupt();
    }
    ...
...
{code}

The job thread stays running, and does not get any information about the 
scheduler shutdown.

Also, if it worked, I would like to be able to configure the behavior in 
quartz.properties (which I supply to {{QuartzComponent}}), as opposed to 
configuring it on the {{QuartzComponent}} itself. 
At this moment, it is needed to supply the {{interruptJobsOnShutdown}} to the 
{{QuartzComponent}}, even if my {{quartz.properties}} already contains 
{{org.quartz.scheduler.interruptJobsOnShutdown=true}}.


> quartz - jobs are not interrupted even if requested
> ---------------------------------------------------
>
>                 Key: CAMEL-16581
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16581
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-quartz
>    Affects Versions: 3.6.0
>            Reporter: Rastislav Papp
>            Priority: Major
>
> camel-quartz provides option {{interruptJobsOnShutdown}}, which says the 
> running jobs will be interrupted. 
> {{org.apache.camel.component.quartz.CamelJob}} does not implement 
> {{org.quartz.InterruptableJob}} though, so when shutting down the scheduler, 
> the running jobs in fact will *not* be interrupted, as per implementation of 
> {{org.quartz.core.QuartzScheduler#shutdown(boolean)}}: 
> {code:java}
> ...
> if(job.getJobInstance() instanceof InterruptableJob)
>     try {
>         ((InterruptableJob)job.getJobInstance()).interrupt();
>     }
>     ...
> ...
> {code}
> The job thread stays running, and does not get any information about the 
> scheduler shutdown.
> Also, if it worked, I would like to be able to configure the behavior in 
> quartz.properties (which I supply to {{QuartzComponent}}), as opposed to 
> configuring it on the {{QuartzComponent}} itself. 
> At this moment, it is needed to supply the {{interruptJobsOnShutdown}} to the 
> {{QuartzComponent}}, even if my {{quartz.properties}} already contains 
> {{org.quartz.scheduler.interruptJobsOnShutdown=true}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to