You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "alberto.zigoni" <al...@gmail.com> on 2012/11/26 13:52:34 UTC

Camel 2.10.2 timer component does not fire at startup

Dear Camel community,

I have noticed a problem with the timer component. I have this route here:

		<route id="sessionTokenRefresher">
			<from uri="timer://scheduler?fixedRate=true&amp;period=1800s" />
			<process ref="authenticateProcessor" />
			<log message="updated session token at ${property.CamelTimerFiredTime}"
/>
		</route>

that is supposed to fire when the route is started during normal Camel
context startup.

Since I migrated to version 2.10.2, the route doesn't fire anymore on
startup. I have seen that if I connect via JMX and manually stop/start the
route, then the timer fires.

I have tried with the delay and initialDelay parameters, but with no luck so
far.

Could this be a bug? Or is it a change by-design in how the component works?
If so, how could I force a fire upon startup?

Thanks in advance.

Alberto




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-10-2-timer-component-does-not-fire-at-startup-tp5723232.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel 2.10.2 timer component does not fire at startup

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Mar 13, 2013 at 8:56 PM, jerome <je...@systar.com> wrote:
> I am having indeed the same issue.
> How to make this fire as soon as the route starts and every 1800 seconds
> afterwards?
> From the documentation I was assuming this was the syntax to use:
>                         <from
> uri="timer://scheduler?fixedRate=true&amp;period=1800s&amp;delay=0" />
> It does not work though
>

You would need to set the delay to a positive value, and not use 0.


>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-2-10-2-timer-component-does-not-fire-at-startup-tp5723232p5729141.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Camel 2.10.2 timer component does not fire at startup

Posted by jerome <je...@systar.com>.
I am having indeed the same issue.
How to make this fire as soon as the route starts and every 1800 seconds
afterwards?
>From the documentation I was assuming this was the syntax to use:
                        <from
uri="timer://scheduler?fixedRate=true&amp;period=1800s&amp;delay=0" />
It does not work though



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-10-2-timer-component-does-not-fire-at-startup-tp5723232p5729141.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel 2.10.2 timer component does not fire at startup

Posted by "alberto.zigoni" <al...@gmail.com>.
Update:

I have experimented a bit with the delay option. If set to 0 it does not
fire, but if I set it to 10ms or more it works.

So apparently the problem is only with 0ms (which should be the default) or
very small values.


On Mon, Nov 26, 2012 at 2:33 PM, alberto.zigoni [via Camel] <
ml-node+s465427n5723235h6@n5.nabble.com> wrote:

> Thanks Claus,
>
> I tried this, but it didn't work. I tried both with delay and
> initialDelay.
>
> This wasn't happening with previous versions of Camel, this is why I'm
> writing here.
>
> Besides, it wouldn't explain why, after a manual stop/start of the route
> via JMX, the timer fires right after the route is started.
>
> Best,
>
> Alberto
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Camel-2-10-2-timer-component-does-not-fire-at-startup-tp5723232p5723235.html
>  To unsubscribe from Camel 2.10.2 timer component does not fire at
> startup, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5723232&code=YWxiZXJ0by56aWdvbmlAZ21haWwuY29tfDU3MjMyMzJ8LTMyMDQ5NjIxNA==>
> .
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-10-2-timer-component-does-not-fire-at-startup-tp5723232p5723251.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel 2.10.2 timer component does not fire at startup

Posted by "alberto.zigoni" <al...@gmail.com>.
Thanks Claus,

I tried this, but it didn't work. I tried both with delay and initialDelay.

This wasn't happening with previous versions of Camel, this is why I'm
writing here.

Besides, it wouldn't explain why, after a manual stop/start of the route via
JMX, the timer fires right after the route is started.

Best,

Alberto



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-10-2-timer-component-does-not-fire-at-startup-tp5723232p5723235.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel 2.10.2 timer component does not fire at startup

Posted by Claus Ibsen <cl...@gmail.com>.
Oh and you can use delay=1000 or something for the 1st firing, to be
after 1 sec, and then after that the delay option is used



On Mon, Nov 26, 2012 at 2:13 PM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> It starts after 1800s.
>
>
> On Mon, Nov 26, 2012 at 1:52 PM, alberto.zigoni
> <al...@gmail.com> wrote:
>> 1800s
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Camel 2.10.2 timer component does not fire at startup

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

It starts after 1800s.


On Mon, Nov 26, 2012 at 1:52 PM, alberto.zigoni
<al...@gmail.com> wrote:
> 1800s



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen