[ 
https://issues.apache.org/jira/browse/CAMEL-5542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13937974#comment-13937974
 ] 

metatech commented on CAMEL-5542:
---------------------------------

For the record, this changes creates a regression for our routes when migrating 
from ServiceMix 4.4 to ServiceMix 4.5.
The secondary route in which we use this timer populates a cache, which must be 
initialized before other primary routes in the bundle can use it, otherwise 
requests sent to these other routes will generate errors.
In our ServiceMix installation with all the other bundles, the bundle with the 
timer can take from 1 second to 30 seconds to start-up, depending on the 
machine speed and the number of other bundles which are installed/started at 
the same time.  
It is therefore very difficult to estimate the time to define for the "delay" 
variable.  If set too low, the first fire will be ignored and the other primary 
routes will generate errors until the timer second fire. If set too high, the 
other primary routes will generate errors until the timer first fire.  
Normally the timer period is set to refresh the cache every several minutes, 
which leaves a large window where requests end with an error in case the cache 
failed to initialize.
A solution with a StartupListener would effectively reduce the window of errors 
to a fraction of a second.
Also, it would help to debug these kind of problems if a "warn" log is added 
when the first timer fire is ignored.
Can you suggest any "wise" way to solve this problem ?
Thanks.

> Timer component - Should defer scheduling tasks during startup of CamelContext
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-5542
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5542
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.10.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.9.4, 2.10.2, 2.11.0
>
>
> We should defer scheduling timer tasks during startup of CamelContext. As 
> they may fire very fast. We should defer this using a StartupListener just as 
> we do with quartz component etc.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to