Hi I have improved this recently. - Camel will not throw exception when stopping - A new pluggable API for providing you own logic what to do in case of excpetions: PollingConsumerPollStrategy
See more at: http://camel.apache.org/polling-consumer.html mind that it takes 1-2 hours for the static html pages to be updated with the dynamic wiki changes I just do On Mon, Jun 22, 2009 at 6:44 PM, Siegfried.Wirth<siegfried.wi...@capgemini-sdm.com> wrote: > > Hi, > > when testing some ftp functionality I found the following issue which may > indicate a bug in ScheduledPollingConsumer: > > 1) I start a route using FtpConsumer (and thus a ScheduledPollingConsumer) > 2) This route encounters an error, because the ftp server is not available > and thus an excpetion is logged. > 3) Now I try to stop the route (to do some reconfigurations and later i want > to start it again) and everything fails... > > I think there is the following problem in ScheduledPollingConsumer: > - When the run-Methods tries to poll and poll throws an exception, the > consumer 'remembers' this exception as firstExceptionThrown (there is a > variable named so in the polling consumer). > - When later on the route is stopped and therefore the > ScheduledPollingConsumer is stop the method doStop() is invoked. There is > the following code: > > doStop() { > [//call the real implementors to stop] > ... > if (firstExceptionThrown != null) { > throw firstExceptionThrown; > } > ... > } > > So this will throw an exception even if stopping the route works fine. > Therefore an exception is thrown in the context of stopping the route that > occured in quite normal situation - but because it is thrown there, it is > really thrown and leads to failures. > > I think every method needs its own variable firstExceptionThrown, to avoid > such cross-throwing-exception. > > Regards, > Siegfried Wirth > -- > View this message in context: > http://www.nabble.com/Bug-in-ScheduledPollingConsumer--tp24151070p24151070.html > Sent from the Camel - Users 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