[jira] [Updated] (CAMEL-8705) FailedToCreateRouteException when using Simple/CronScheduledRoutePolicy with several "from"

2015-04-27 Thread Jonas Waage (JIRA)

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

Jonas Waage updated CAMEL-8705:
---
Patch Info: Patch Available

> FailedToCreateRouteException when using Simple/CronScheduledRoutePolicy with 
> several "from"
> ---
>
> Key: CAMEL-8705
> URL: https://issues.apache.org/jira/browse/CAMEL-8705
> Project: Camel
>  Issue Type: Bug
>  Components: camel-quartz, camel-quartz2
>Affects Versions: 2.15.1
>Reporter: Jonas Waage
>Priority: Minor
> Attachments: ScheduledRoutePolicy.txt
>
>
> Camel will throw FailedToCreateRouteException when using 
> SimpleScheduledRoutePolicy or CronScheduledRoutePolicy on routes defined with 
> several "from" (as below).
> {noformat}
> <<< FAILURE! - in 
> org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicyTest
> testScheduledSuspendAndRestartPolicyTwoConsumers(org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicyTest)
>   Time elapsed: 0.839 sec  <<< ERROR!
> org.apache.camel.FailedToCreateRouteException: Failed to create route test: 
> Route(test)[[From[direct:start], From[direct:start2]] -> [To... because of 
> org.quartz.ObjectAlreadyExistsException: Unable to store Job : 
> 'jobGroup-test.job-START-test', because one already exists with this 
> identification.
> {noformat}
> {code:java}
> context.addRoutes(new RouteBuilder() {
> public void configure() {
> SimpleScheduledRoutePolicy policy = new 
> SimpleScheduledRoutePolicy();
> long suspendTime = System.currentTimeMillis() + 1000L;
> policy.setRouteSuspendDate(new Date(suspendTime));
> policy.setRouteSuspendRepeatCount(0);
> long startTime = System.currentTimeMillis() + 4000L;
> policy.setRouteStartDate(new Date(startTime));
> policy.setRouteResumeRepeatCount(1);
> policy.setRouteResumeRepeatInterval(3000);
> 
> from("direct:start").from("direct:start2")
> .routeId("test")
> .routePolicy(policy)
> .to("mock:success");
> } 
> });
> {code}



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


[jira] [Updated] (CAMEL-8705) FailedToCreateRouteException when using Simple/CronScheduledRoutePolicy with several "from"

2015-04-27 Thread Jonas Waage (JIRA)

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

Jonas Waage updated CAMEL-8705:
---
Attachment: ScheduledRoutePolicy.txt

Possible patch that builds Id from "from" and not routeId.

> FailedToCreateRouteException when using Simple/CronScheduledRoutePolicy with 
> several "from"
> ---
>
> Key: CAMEL-8705
> URL: https://issues.apache.org/jira/browse/CAMEL-8705
> Project: Camel
>  Issue Type: Bug
>  Components: camel-quartz, camel-quartz2
>Affects Versions: 2.15.1
>Reporter: Jonas Waage
>Priority: Minor
> Attachments: ScheduledRoutePolicy.txt
>
>
> Camel will throw FailedToCreateRouteException when using 
> SimpleScheduledRoutePolicy or CronScheduledRoutePolicy on routes defined with 
> several "from" (as below).
> {noformat}
> <<< FAILURE! - in 
> org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicyTest
> testScheduledSuspendAndRestartPolicyTwoConsumers(org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicyTest)
>   Time elapsed: 0.839 sec  <<< ERROR!
> org.apache.camel.FailedToCreateRouteException: Failed to create route test: 
> Route(test)[[From[direct:start], From[direct:start2]] -> [To... because of 
> org.quartz.ObjectAlreadyExistsException: Unable to store Job : 
> 'jobGroup-test.job-START-test', because one already exists with this 
> identification.
> {noformat}
> {code:java}
> context.addRoutes(new RouteBuilder() {
> public void configure() {
> SimpleScheduledRoutePolicy policy = new 
> SimpleScheduledRoutePolicy();
> long suspendTime = System.currentTimeMillis() + 1000L;
> policy.setRouteSuspendDate(new Date(suspendTime));
> policy.setRouteSuspendRepeatCount(0);
> long startTime = System.currentTimeMillis() + 4000L;
> policy.setRouteStartDate(new Date(startTime));
> policy.setRouteResumeRepeatCount(1);
> policy.setRouteResumeRepeatInterval(3000);
> 
> from("direct:start").from("direct:start2")
> .routeId("test")
> .routePolicy(policy)
> .to("mock:success");
> } 
> });
> {code}



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