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 2011/02/20 08:38:38 UTC
[jira] Created: (CAMEL-3688) Add repeatCount option to timer
component
Add repeatCount option to timer component
-----------------------------------------
Key: CAMEL-3688
URL: https://issues.apache.org/jira/browse/CAMEL-3688
Project: Camel
Issue Type: New Feature
Components: camel-core
Affects Versions: 2.6.0
Reporter: Claus Ibsen
Priority: Minor
Fix For: 2.7.0
Sometimes you may just want to trigger a route once on startup. And using a timer for that would be easy. But the timer will keep firing. So we need a {{repeatCount}} option.
If we exceed the count then it should not emit any message.
Ideally it should unschedule the task, and reset the count.
Remember the current count is state full per timer task. So it needs to be stored on the task. As you can have multiple timer tasks running (eg with different names)
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (CAMEL-3688) Add repeatCount option to timer
component
Posted by "Tracy Snell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998426#comment-12998426 ]
Tracy Snell commented on CAMEL-3688:
------------------------------------
Correction! We don't enforce unique timer names.
> Add repeatCount option to timer component
> -----------------------------------------
>
> Key: CAMEL-3688
> URL: https://issues.apache.org/jira/browse/CAMEL-3688
> Project: Camel
> Issue Type: New Feature
> Components: camel-core
> Affects Versions: 2.6.0
> Reporter: Claus Ibsen
> Assignee: Tracy Snell
> Priority: Minor
> Fix For: 2.7.0
>
>
> Sometimes you may just want to trigger a route once on startup. And using a timer for that would be easy. But the timer will keep firing. So we need a {{repeatCount}} option.
> If we exceed the count then it should not emit any message.
> Ideally it should unschedule the task, and reset the count.
> Remember the current count is state full per timer task. So it needs to be stored on the task. As you can have multiple timer tasks running (eg with different names)
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (CAMEL-3688) Add repeatCount option to timer
component
Posted by "Tracy Snell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997275#comment-12997275 ]
Tracy Snell commented on CAMEL-3688:
------------------------------------
timer:foo and timer:bar would create 2 endpoints so it should be fine to just store the repeatCount on the endpoint correct?
> Add repeatCount option to timer component
> -----------------------------------------
>
> Key: CAMEL-3688
> URL: https://issues.apache.org/jira/browse/CAMEL-3688
> Project: Camel
> Issue Type: New Feature
> Components: camel-core
> Affects Versions: 2.6.0
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 2.7.0
>
>
> Sometimes you may just want to trigger a route once on startup. And using a timer for that would be easy. But the timer will keep firing. So we need a {{repeatCount}} option.
> If we exceed the count then it should not emit any message.
> Ideally it should unschedule the task, and reset the count.
> Remember the current count is state full per timer task. So it needs to be stored on the task. As you can have multiple timer tasks running (eg with different names)
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (CAMEL-3688) Add repeatCount option to timer
component
Posted by "Tracy Snell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997361#comment-12997361 ]
Tracy Snell commented on CAMEL-3688:
------------------------------------
We do enforce unique timer names. So your example would throw an error. I'll stick the value in the endpoint for now.
> Add repeatCount option to timer component
> -----------------------------------------
>
> Key: CAMEL-3688
> URL: https://issues.apache.org/jira/browse/CAMEL-3688
> Project: Camel
> Issue Type: New Feature
> Components: camel-core
> Affects Versions: 2.6.0
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 2.7.0
>
>
> Sometimes you may just want to trigger a route once on startup. And using a timer for that would be easy. But the timer will keep firing. So we need a {{repeatCount}} option.
> If we exceed the count then it should not emit any message.
> Ideally it should unschedule the task, and reset the count.
> Remember the current count is state full per timer task. So it needs to be stored on the task. As you can have multiple timer tasks running (eg with different names)
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (CAMEL-3688) Add repeatCount option to timer
component
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998734#comment-12998734 ]
Claus Ibsen commented on CAMEL-3688:
------------------------------------
Yeah you need to stick the state into each individual task which are scheduled. That's easy to do in the following code
{code}
task = new TimerTask() {
@Override
public void run() {
sendTimerExchange();
}
};
{code}
And when we exceeded you can cancel the task using task.cancel(); Which fingers-crossed would let the JDK unschedule the task. And maybe also reset the counter, in case end user re-start the consumer. In case we want it to schedule and emit messages again.
> Add repeatCount option to timer component
> -----------------------------------------
>
> Key: CAMEL-3688
> URL: https://issues.apache.org/jira/browse/CAMEL-3688
> Project: Camel
> Issue Type: New Feature
> Components: camel-core
> Affects Versions: 2.6.0
> Reporter: Claus Ibsen
> Assignee: Tracy Snell
> Priority: Minor
> Fix For: 2.7.0
>
>
> Sometimes you may just want to trigger a route once on startup. And using a timer for that would be easy. But the timer will keep firing. So we need a {{repeatCount}} option.
> If we exceed the count then it should not emit any message.
> Ideally it should unschedule the task, and reset the count.
> Remember the current count is state full per timer task. So it needs to be stored on the task. As you can have multiple timer tasks running (eg with different names)
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (CAMEL-3688) Add repeatCount option to timer
component
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-3688.
--------------------------------
Resolution: Fixed
Also updated the wiki documentation.
> Add repeatCount option to timer component
> -----------------------------------------
>
> Key: CAMEL-3688
> URL: https://issues.apache.org/jira/browse/CAMEL-3688
> Project: Camel
> Issue Type: New Feature
> Components: camel-core
> Affects Versions: 2.6.0
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 2.8.0
>
>
> Sometimes you may just want to trigger a route once on startup. And using a timer for that would be easy. But the timer will keep firing. So we need a {{repeatCount}} option.
> If we exceed the count then it should not emit any message.
> Ideally it should unschedule the task, and reset the count.
> Remember the current count is state full per timer task. So it needs to be stored on the task. As you can have multiple timer tasks running (eg with different names)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Assigned: (CAMEL-3688) Add repeatCount option to timer
component
Posted by "Tracy Snell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tracy Snell reassigned CAMEL-3688:
----------------------------------
Assignee: Tracy Snell
> Add repeatCount option to timer component
> -----------------------------------------
>
> Key: CAMEL-3688
> URL: https://issues.apache.org/jira/browse/CAMEL-3688
> Project: Camel
> Issue Type: New Feature
> Components: camel-core
> Affects Versions: 2.6.0
> Reporter: Claus Ibsen
> Assignee: Tracy Snell
> Priority: Minor
> Fix For: 2.7.0
>
>
> Sometimes you may just want to trigger a route once on startup. And using a timer for that would be easy. But the timer will keep firing. So we need a {{repeatCount}} option.
> If we exceed the count then it should not emit any message.
> Ideally it should unschedule the task, and reset the count.
> Remember the current count is state full per timer task. So it needs to be stored on the task. As you can have multiple timer tasks running (eg with different names)
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (CAMEL-3688) Add repeatCount option to timer
component
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-3688:
----------------------------------
Assignee: Claus Ibsen (was: Tracy Snell)
> Add repeatCount option to timer component
> -----------------------------------------
>
> Key: CAMEL-3688
> URL: https://issues.apache.org/jira/browse/CAMEL-3688
> Project: Camel
> Issue Type: New Feature
> Components: camel-core
> Affects Versions: 2.6.0
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 2.8.0
>
>
> Sometimes you may just want to trigger a route once on startup. And using a timer for that would be easy. But the timer will keep firing. So we need a {{repeatCount}} option.
> If we exceed the count then it should not emit any message.
> Ideally it should unschedule the task, and reset the count.
> Remember the current count is state full per timer task. So it needs to be stored on the task. As you can have multiple timer tasks running (eg with different names)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (CAMEL-3688) Add repeatCount option to timer
component
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-3688:
-------------------------------
Fix Version/s: (was: 2.7.0)
2.8.0
> Add repeatCount option to timer component
> -----------------------------------------
>
> Key: CAMEL-3688
> URL: https://issues.apache.org/jira/browse/CAMEL-3688
> Project: Camel
> Issue Type: New Feature
> Components: camel-core
> Affects Versions: 2.6.0
> Reporter: Claus Ibsen
> Assignee: Tracy Snell
> Priority: Minor
> Fix For: 2.8.0
>
>
> Sometimes you may just want to trigger a route once on startup. And using a timer for that would be easy. But the timer will keep firing. So we need a {{repeatCount}} option.
> If we exceed the count then it should not emit any message.
> Ideally it should unschedule the task, and reset the count.
> Remember the current count is state full per timer task. So it needs to be stored on the task. As you can have multiple timer tasks running (eg with different names)
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (CAMEL-3688) Add repeatCount option to timer
component
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997293#comment-12997293 ]
Claus Ibsen commented on CAMEL-3688:
------------------------------------
I can't remember if we force unique timer name, but you could have
from(timer:foo?period=1000)...
and another route
from(timer:foo?period=2500)...
> Add repeatCount option to timer component
> -----------------------------------------
>
> Key: CAMEL-3688
> URL: https://issues.apache.org/jira/browse/CAMEL-3688
> Project: Camel
> Issue Type: New Feature
> Components: camel-core
> Affects Versions: 2.6.0
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 2.7.0
>
>
> Sometimes you may just want to trigger a route once on startup. And using a timer for that would be easy. But the timer will keep firing. So we need a {{repeatCount}} option.
> If we exceed the count then it should not emit any message.
> Ideally it should unschedule the task, and reset the count.
> Remember the current count is state full per timer task. So it needs to be stored on the task. As you can have multiple timer tasks running (eg with different names)
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira