[
https://issues.apache.org/jira/browse/CAMEL-4928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13190591#comment-13190591
]
Sergey Zhemzhitsky commented on CAMEL-4928:
-------------------------------------------
New _async_ parameter has been added in the included patch.
{code:title=Sample}
from("timer:start?async=true")
.threads(1, 5)
.to("bean:very-long-operation")
{code}
So by default the behavior is exactly the same as in the previous version of
timer and if one want to use asynchronous API _async=true_ parameter should be
added in the endpoint uri.
The patch also includes _doSuspend_ and _doResume_ methods in the TimerConsumer
to be able to stop the route faster and to prevent the timer running during
stopping the route when using async. api.
> Async API support by the Timer component
> ----------------------------------------
>
> Key: CAMEL-4928
> URL: https://issues.apache.org/jira/browse/CAMEL-4928
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.9.0
> Reporter: Sergey Zhemzhitsky
> Labels: timer
> Attachments: CAMEL-4928.patch
>
>
> It would be great to have timer component support asynchronous API.
> Such a feature can be useful when timer component generates events which must
> be processed by multiple threads.
> Current implementation of the timer component makes a blocking call so the
> usage of thread pools hardly possible to process multiple timer event
> simultaneously.
> {code:title=Sample}
> from("timer:start")
> .threads(1, 5)
> .to("bean:very-long-operation");
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira