camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Timer endpoint and errorHandler
Date Mon, 04 May 2009 14:17:11 GMT
Hi

On Mon, May 4, 2009 at 3:07 PM, arhan <ant.arhipov@gmail.com> wrote:
>
> Hi,
>
> See the code snipped below.
> I'm using the timer endpoint to execute some route periodically, and it
> works until I add error handler. If errorHandler(..) is included, the
> process doesn't stay up and running but instead it does all the
> initialization and exits gracefully.
I just added unit test in Camel 2.0 that looks like you route and it works:
http://svn.apache.org/viewvc?view=rev&revision=771312

What version of Camel are you using?

The reason could be the body message is null, as the timer does not
create any input message.
There was such a bug in Camel 1.3/1.4 when using the tracer.

You can try adding
.setBody(constant(""))

>
>
> RouteBuilder routeBuilder = new RouteBuilder(){
>   public void configure() throws Exception {
>
>     onException(RuntimeCamelException.class).handled(true);
>     errorHandler(loggingErrorHandler(getClass().getName()));  //Here's the
> problem
>
>      String executionTriggerUri = "timer:executionTimer"
>                                 + "?fixedRate=true"
>                                 + "&daemon=true"
>                                 + "&period=5000";
>
>     from(executionTriggerUri).to("bean:someBean");
>   }
> }
> --
> View this message in context: http://www.nabble.com/Timer-endpoint-and-errorHandler-tp23366970p23366970.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Apache Camel Reference Card:
http://refcardz.dzone.com/refcardz/enterprise-integration

Mime
View raw message