You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2010/07/10 18:59:51 UTC
[jira] Created: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
--------------------------------------------------------------------------------------
Key: CAMEL-2936
URL: https://issues.apache.org/activemq/browse/CAMEL-2936
Project: Apache Camel
Issue Type: New Feature
Components: camel-core
Reporter: Claus Ibsen
Priority: Minor
Fix For: Future
A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ashwin Karpe updated CAMEL-2936:
--------------------------------
Comment: was deleted
(was: Hi Claus,
I have added the patch to the camel core as revision r1001004.
I will wait for your comments on the quartz patch
Cheers,
Ashwin...)
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
> Attachments: CAMEL-2936-Core-routepolicy.diff, CAMEL-2936-ScheduledRoutePolicy.diff
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61879#action_61879 ]
Ashwin Karpe commented on CAMEL-2936:
-------------------------------------
Hi Claus,
I am extending the abstract RoutePolicySupport class and add a ScheduledRoutePolicySupport class in the camel core which I intend to use in the Scheduled RoutePolicy code...
Cheers,
Ashwin...
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62089#action_62089 ]
Claus Ibsen commented on CAMEL-2936:
------------------------------------
And we need unit tests which is using Spring XML as well.
And would be nice with java doc on the some of the methods that the Camel end user can configure. Just so he understands what it does, eg {{setRouteStopGracePeriod}}
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
> Attachments: CAMEL-2936-Core-routepolicy.diff, CAMEL-2936-ScheduledRoutePolicy.diff
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62076#action_62076 ]
Ashwin Karpe commented on CAMEL-2936:
-------------------------------------
Hi Claus,
I did a thorough re-check of the policy feature and find everything in compliance with the things you have typically identified in the past. I will check in the ScheduledRoutePolicy for now. I will of course be happy to perform any edits based on your thoughts and comments.
Cheers,
Ashwin...
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
> Attachments: CAMEL-2936-Core-routepolicy.diff, CAMEL-2936-ScheduledRoutePolicy.diff
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61675#action_61675 ]
Ashwin Karpe commented on CAMEL-2936:
-------------------------------------
Hi Claus,
Is this a policy that will be registered against a camel context to provide guidance on how/which routes may be started/stopped.
BTW, I recently put together a cool piece of code that does route mutations of producers/consumers on the fly based on configuration settings. I wonder if I could roll this king of ability with the camelcontext as well allowing a user to mutate a route on the fly.
Please let me know.
Cheers,
Ashwin...
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62205#action_62205 ]
Ashwin Karpe commented on CAMEL-2936:
-------------------------------------
Committed camel-quartz updated patch as revision r1002354
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
> Attachments: CAMEL-2936-Core-routepolicy.diff, CAMEL-2936-ScheduledRoutePolicy.diff, camel-2936-updated.diff
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62077#action_62077 ]
Ashwin Karpe commented on CAMEL-2936:
-------------------------------------
Checked in camel-core patch as revision r1001004
Checked in camel-quartz patch as revisions (r1001028 & r1001031)
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
> Attachments: CAMEL-2936-Core-routepolicy.diff, CAMEL-2936-ScheduledRoutePolicy.diff
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CAMEL-2936) Provided a
ScheduledRoutePolicy to make it easy to define when routes should be active
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62088#action_62088 ]
Claus Ibsen edited comment on CAMEL-2936 at 9/25/10 2:05 AM:
-------------------------------------------------------------
Looks good, however there are two issue = OSGi & not re-using existing quartz scheduler.
Loading properties should be using the {{ClassResolver}} from {{CamelContext}}. See the {{loadProperties}} method in {{QuartzComponent}}.
But I think a better solution would be to re-use the {{QuartzComponent}} in the route policy. As the component has all the quartz scheduler bits already and working in OSGi.
Also people want to use the same quartz scheduler for route policies and if they use quartz in the camel routes as well.
You can get the quartz component from the {{onInit}} method
{code}
QuartzComponent quartz = route.getRouteContext().getCamelContext().getComponent("quartz", QuartzComponent.class);
{code}
So your class {[ScheduledRoutePolicy}} should use {{QuartzComponent}}.
You may need to alter the API in QuartzCompent a bit if there is some pieces missing for you.
was (Author: davsclaus):
Looks good, however there is one issue = OSGi.
Loading properties should be using the {{ClassResolver}} from {{CamelContext}}. See the {{loadProperties}} method in {{QuartzComponent}}.
But I think a better solution would be to re-use the {{QuartzComponent}} in the route policy. As the component has all the quartz scheduler bits already and working in OSGi.
Also people want to use the same quartz scheduler for route policies and if they use quartz in the camel routes as well.
You can get the quartz component from the {{onInit}} method
{code}
QuartzComponent quartz = route.getRouteContext().getCamelContext().getComponent("quartz", QuartzComponent.class);
{code}
So your class {[ScheduledRoutePolicy}} should use {{QuartzComponent}}.
You may need to alter the API in QuartzCompent a bit if there is some pieces missing for you.
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
> Attachments: CAMEL-2936-Core-routepolicy.diff, CAMEL-2936-ScheduledRoutePolicy.diff
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Work started: (CAMEL-2936) Provided a ScheduledRoutePolicy
to make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Work on CAMEL-2936 started by Ashwin Karpe.
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62088#action_62088 ]
Claus Ibsen commented on CAMEL-2936:
------------------------------------
Looks good, however there is one issue = OSGi.
Loading properties should be using the {{ClassResolver}} from {{CamelContext}}. See the {{loadProperties}} method in {{QuartzComponent}}.
But I think a better solution would be to re-use the {{QuartzComponent}} in the route policy. As the component has all the quartz scheduler bits already and working in OSGi.
Also people want to use the same quartz scheduler for route policies and if they use quartz in the camel routes as well.
You can get the quartz component from the {{onInit}} method
{code}
QuartzComponent quartz = route.getRouteContext().getCamelContext().getComponent("quartz", QuartzComponent.class);
{code}
So your class {[ScheduledRoutePolicy}} should use {{QuartzComponent}}.
You may need to alter the API in QuartzCompent a bit if there is some pieces missing for you.
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
> Attachments: CAMEL-2936-Core-routepolicy.diff, CAMEL-2936-ScheduledRoutePolicy.diff
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62075#action_62075 ]
Ashwin Karpe commented on CAMEL-2936:
-------------------------------------
Hi Claus,
I have added the patch to the camel core as revision r1001004.
I will wait for your comments on the quartz patch
Cheers,
Ashwin...
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
> Attachments: CAMEL-2936-Core-routepolicy.diff, CAMEL-2936-ScheduledRoutePolicy.diff
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CAMEL-2936) Provided a
ScheduledRoutePolicy to make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61878#action_61878 ]
Ashwin Karpe edited comment on CAMEL-2936 at 9/16/10 6:16 PM:
--------------------------------------------------------------
Hi Claus,
The real challenge with the scheduled route policy support it seems is in re-starting the route or a consumer at a given time and the most elegant and only real way is to use a CRON parser.
I looked for a way to implement this capability in camel-core, however, I find that I will need to edit the pom and add a quartz dependency which I would like to avoid. Given this, it seems like only other way is to offer this via the camel-quartz component and not camel-core. In this case, I will be able to get add a comprehensive, extensive & rich set of policies utilizing quartz scheduling capabilities.
Please let me know what you think. If there is any other way to do this please let me know.
I will proceed along the lines described above and avoid mucking up the camel core with this dependency unless you recommend otherwise.
Cheers,
Ashwin...
was (Author: akarpe):
Hi Claus,
The real challenge with the scheduled route policy support it seems is in re-starting the route or a consumer at a given time and the most elegant and only real way way is to use a CRON parser.
I looked for a way to implement this capability in camel-core, however, I find that I will need to edit the pom and add a quartz dependency which I would like to avoid. Given this, it seems like only other way is to offer this via the camel-quartz component and not camel-core. In this case, I will be able to get add a comprehensive, extensive & rich set of policies utilizing quartz scheduling capabilities.
Please let me know what you think. If there is any other way to do this please let me know.
I will proceed along the lines described above and avoid mucking up the camel core with this dependency unless you recommend otherwise.
Cheers,
Ashwin...
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CAMEL-2936) Provided a
ScheduledRoutePolicy to make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61675#action_61675 ]
Ashwin Karpe edited comment on CAMEL-2936 at 9/3/10 5:05 PM:
-------------------------------------------------------------
Hi Claus,
Is this a policy that will be registered against a camel context to provide guidance on how/which routes may be started/stopped.
BTW, I recently put together a cool piece of code that does route mutations of producers/consumers on the fly based on JMX event notifications. I wonder if I could roll this kind of capability with the camel context as well allowing a user to mutate a route on the fly.
Please let me know.
Cheers,
Ashwin...
was (Author: akarpe):
Hi Claus,
Is this a policy that will be registered against a camel context to provide guidance on how/which routes may be started/stopped.
BTW, I recently put together a cool piece of code that does route mutations of producers/consumers on the fly based on configuration settings. I wonder if I could roll this king of ability with the camelcontext as well allowing a user to mutate a route on the fly.
Please let me know.
Cheers,
Ashwin...
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CAMEL-2936) Provided a
ScheduledRoutePolicy to make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62201#action_62201 ]
Ashwin Karpe edited comment on CAMEL-2936 at 9/28/10 4:47 PM:
--------------------------------------------------------------
Hi Claus,
Please find attached an update patch for the ScheduledRoutePolicy support
I have modified the code to make use of the QuartzComponent and use its API's to get a reference to the scheduler. I have also added Spring unit tests and verified that everything is in order including checkstyle checks to ensure the code is style compliant.
Please let me know if you have would like any other updates. I will check this in and will be happy to incorporate any changes or updates you seek.
Cheers,
Ashwin...
was (Author: akarpe):
Hi Claus,
Please find attached an update patch for the ScheduledRoutePolicy support
I have modified the code to make use of the QuartzComponent and use its API's to get a reference to the scheduler. I have also added Spring unit tests and verified that everything is in order.
I have also performed checkstyle checks to ensure the code is style compliant.
Please let me know if you have would like any other updates. I will check this in and will be happy to incorporate any changes or updates you seek.
Cheers,
Ashwin...
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
> Attachments: CAMEL-2936-Core-routepolicy.diff, CAMEL-2936-ScheduledRoutePolicy.diff, camel-2936-updated.diff
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ashwin Karpe updated CAMEL-2936:
--------------------------------
Attachment: CAMEL-2936-Core-routepolicy.diff
CAMEL-2936-ScheduledRoutePolicy.diff
Hi Claus,
I am attaching 2 patches (1 for camel core, 1 for camel quartz) for this ScheduledRoutePolicy feature in Camel. I am offering both a Cron based and Simple ScheduledRoutePolicy support.
I could have come up with one patch, but the core patch could be added independent of the quartz patch.
In the core patch, I have added an extra API to the RoutePolicy support for stopRoute() which takes into account an ability to provide a timeout for graceful shutdown before shutting down a route.
I have unit-tested & source-checked the feature and am offering the capability for your comment. I will check it in shortly.
Cheers,
Ashwin...
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
> Attachments: CAMEL-2936-Core-routepolicy.diff, CAMEL-2936-ScheduledRoutePolicy.diff
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ashwin Karpe reassigned CAMEL-2936:
-----------------------------------
Assignee: Ashwin Karpe
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62103#action_62103 ]
Ashwin Karpe commented on CAMEL-2936:
-------------------------------------
Hi Claus,
Sure thing. I will check out the Quartz Component and use its capabilities to loadProperties and link the Route Policy more closely to the QuartzComponent.
Will add Spring tests to the component as well.
Cheers,
Ashwin...
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
> Attachments: CAMEL-2936-Core-routepolicy.diff, CAMEL-2936-ScheduledRoutePolicy.diff
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61682#action_61682 ]
Claus Ibsen commented on CAMEL-2936:
------------------------------------
Ashwin check this documentation
http://camel.apache.org/routepolicy.html
The idea is to assign routes with a policy which dictates when those routes is active.
The policy should have it easy to define rules such as based on CRON or a simple rules based on a window opening (eg. 8am to 6pm).
The trick is with CRON we have to leverage quartz as it got a CRON parser. Or in the future Spring 3 which may also have one.
But for starters go for the simple solution with something that is easy to configure out of the box.
Sometimes people want routes to be inactive during night time when backup and other jobs may run.
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61884#action_61884 ]
Claus Ibsen commented on CAMEL-2936:
------------------------------------
Yeah perfect to supply the cron based in camel-quartz.
You can have some base class on camel-core if that makes sense.
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61878#action_61878 ]
Ashwin Karpe commented on CAMEL-2936:
-------------------------------------
Hi Claus,
The real challenge with the scheduled route policy support it seems is in re-starting the route or a consumer at a given time and the most elegant and only real way way is to use a CRON parser.
I looked for a way to implement this capability in camel-core, however, I find that I will need to edit the pom and add a quartz dependency which I would like to avoid. Given this, it seems like only other way is to offer this via the camel-quartz component and not camel-core. In this case, I will be able to get add a comprehensive, extensive & rich set of policies utilizing quartz scheduling capabilities.
Please let me know what you think. If there is any other way to do this please let me know.
I will proceed along the lines described above and avoid mucking up the camel core with this dependency unless you recommend otherwise.
Cheers,
Ashwin...
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ashwin Karpe resolved CAMEL-2936.
---------------------------------
Fix Version/s: 2.5.0
(was: Future)
Resolution: Fixed
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: 2.5.0
>
> Attachments: CAMEL-2936-Core-routepolicy.diff, CAMEL-2936-ScheduledRoutePolicy.diff, camel-2936-updated.diff
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAMEL-2936) Provided a ScheduledRoutePolicy to
make it easy to define when routes should be active
Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ashwin Karpe updated CAMEL-2936:
--------------------------------
Attachment: camel-2936-updated.diff
Hi Claus,
Please find attached an update patch for the ScheduledRoutePolicy support
I have modified the code to make use of the QuartzComponent and use its API's to get a reference to the scheduler. I have also added Spring unit tests and verified that everything is in order.
I have also performed checkstyle checks to ensure the code is style compliant.
Please let me know if you have would like any other updates. I will check this in and will be happy to incorporate any changes or updates you seek.
Cheers,
Ashwin...
> Provided a ScheduledRoutePolicy to make it easy to define when routes should be active
> --------------------------------------------------------------------------------------
>
> Key: CAMEL-2936
> URL: https://issues.apache.org/activemq/browse/CAMEL-2936
> Project: Apache Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Ashwin Karpe
> Priority: Minor
> Fix For: Future
>
> Attachments: CAMEL-2936-Core-routepolicy.diff, CAMEL-2936-ScheduledRoutePolicy.diff, camel-2936-updated.diff
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user configuration.
> The scheduled should invoke a callback on regular bases where end user can determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.