On Wed, Apr 18, 2012 at 12:02 AM, brbornia <brbor...@gmail.com> wrote: > Hey guys, > > Forget my last post, I´m feeling stupid right now... The method begin must > return true to continue with the polling. After I fixed that, the polling > strategy started working as expected. >
Yes read the javadoc of the methods. Also for the commit method as well. http://camel.apache.org/javadoc.html > Now, I have another question related to that. I have set in my context an > error handler like this: > > <onException> > <exception>java.lang.Exception</exception> > <some_stuff_here/> > <to uri="activemq:topic:error"/> > </onException> > > But it´s not capturing the exception thrown in my > PollingConsumerPollStrategy, even returning true on rollback method. > Actually, I did not undertand completetly what the return of rollback means. > > Anyway, is that the expected behavior or I am missing something again? Any > suggestions on how I could handle the exception like the above onException > clause? I really would like to use the camel benefits to handle my exception > instead of simple java code. > Yes that is the expected behavior. As said before Camel error handling in the routes (eg onException, errorHandler) only applies when *routing* messages. At this point of stage you do not yet have a message to route. Error handling at this level is *component* specific, how they deal with that. Some components like JMS will be able to retry and failover etc. Others take other actions etc. And in your case there is not even a failure from the file component, there was just no files to poll. However since you have this hook with the strategy, You can create a Camel message that has a pre set exception and send that to a Camel route that triggers the error handling. You can use ProducerTemplate to send a message for example. > Thanks again, > Bruno. > > -- > View this message in context: > http://camel.465427.n5.nabble.com/File2-endpoint-issue-tp5644759p5647730.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/