You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2014/02/20 09:42:20 UTC

[jira] [Resolved] (CAMEL-7215) Stop and un-schedule jobs on removal of route

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

Claus Ibsen resolved CAMEL-7215.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.13.0
                   2.12.3

> Stop and un-schedule jobs on removal of route
> ---------------------------------------------
>
>                 Key: CAMEL-7215
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7215
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-quartz, camel-quartz2
>    Affects Versions: 2.12.2
>         Environment: Using job-store 'org.quartz.simpl.RAMJobStore'
>            Reporter: David Keen
>            Assignee: Willem Jiang
>             Fix For: 2.12.3, 2.13.0
>
>
> When using SimpleScheduledRoutePolicy, jobs are not deleted when a route is removed.
> I got the following exception when removing a route and re-adding it to a running context.
> {code}
> Stacktrace
> ---------------------------------------------------------------------------------------------------------------------------------------
> org.apache.camel.FailedToCreateRouteException: Failed to create route foo: Route(foo)[[From[quartz... because of org.quartz.ObjectAlreadyExistsException: Unable to store Job : 'jobGroup-foo.job-STOP-foo', because one already exists with this identification.
>         at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:182) ~[camel-core-2.12.2.jar:2.12.2]
>         at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:770) ~[camel-core-2.12.2.jar:2.12.2]
>         at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1914) ~[camel-core-2.12.2.jar:2.12.2]
>         at org.apache.camel.impl.DefaultCamelContext.addRouteDefinitions(DefaultCamelContext.java:707) ~[camel-core-2.12.2.jar:2.12.2]
>         at org.apache.camel.builder.RouteBuilder.populateRoutes(RouteBuilder.java:337) ~[camel-core-2.12.2.jar:2.12.2]
>         at org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:264) ~[camel-core-2.12.2.jar:2.12.2]
>         at org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:669) ~[camel-core-2.12.2.jar:2.12.2]
> ...
> Caused by: org.apache.camel.RuntimeCamelException: org.quartz.ObjectAlreadyExistsException: Unable to store Job : 'jobGroup-foo.job-STOP-foo', because one already exists with this identification.
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1352) ~[camel-core-2.12.2.jar:2.12.2]
>         at org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy.onInit(SimpleScheduledRoutePolicy.java:48) ~[camel-quartz2-2.12.2.jar:2.12.2]
>         at org.apache.camel.impl.DefaultRouteContext.commit(DefaultRouteContext.java:202) ~[camel-core-2.12.2.jar:2.12.2]
>         at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:916) ~[camel-core-2.12.2.jar:2.12.2]
> ...
> Caused by: org.quartz.ObjectAlreadyExistsException: Unable to store Job : 'jobGroup-foo.job-STOP-foo', because one already exists with this identification.
>         at org.quartz.simpl.RAMJobStore.storeJob(RAMJobStore.java:279) ~[quartz-2.2.1.jar:na]
>         at org.quartz.simpl.RAMJobStore.storeJobAndTrigger(RAMJobStore.java:251) ~[quartz-2.2.1.jar:na]
>         at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:886) ~[quartz-2.2.1.jar:na]
>         at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:249) ~[quartz-2.2.1.jar:na]
>         at org.apache.camel.routepolicy.quartz2.ScheduledRoutePolicy.scheduleRoute(ScheduledRoutePolicy.java:116) ~[camel-quartz2-2.12.2.jar:2.12.2]
> {code}
> The SimpleScheduledRoutePolicy should remove the scheduled jobs on route removal. This is what CronScheduledRoutePolicy does.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)