camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Endpoint exception handling
Date Sun, 26 Feb 2012 08:26:02 GMT
On Fri, Feb 24, 2012 at 9:12 PM, tkatva <> wrote:
> Hi Claus
> Thank you for your responses... My concern is that I want polling
> FTP/FTPS/SFTP/FILE-endpoints to call my custom code if error occurs... Can
> you point me to a example where I can see how I can apply this
> pollingStrategy to these endpoints ?
> I am constructing endpoints programmatically and creating url's based on
> values received from database. Here is part of my code:
> RouteDefinition routeDef = new RouteDefinition();
> //Endpoint url constructed from values from db
> org.apache.camel.Endpoint fromEnd = camel.getEndpoint(fromUrl);
> routeDef.from(fromEnd);
> //Add "to" endpoints which are constructed the same way
> Then route is added to CamelContext and started later.
> If you could show example how I could add pollingStrategy to
> "fromEnd"-endpoint, you would save my week or maybe whole month ... :)

You would need to register your custom poll strategy in the registry.
If you use Spring XML then its a <bean> tag.
If you use standalone Java, then you may want to use the
SimpleRegistry with CamelContext and add it to this strategy from java

Then in the endpoint uri, you just refer to the id of your custom poll
strategy using #id


If you use Spring XML then

<bean id="myPollStrategy" class=""/>

> Thank you
> Best Regards Tuomas Katva
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message