On Fri, Oct 9, 2009 at 11:20 PM, parasmk <para...@gmail.com> wrote:
>
>
>
> Claus Ibsen-2 wrote:
>>
>>
>> See the pollStrategy option on this page:
>> http://camel.apache.org/polling-consumer.html
>>
>> You can then configure your own poll strategy on the ftp consumer and
>> decide what to do in case of FTP server errors.
>>
>>
>
> Hello again,
> I tried your suggestion and it worked, partially. The control for my
> producer goes to rollback method from
> org.apache.camel.PollingConsumerPollStrategy, but Camel does not respond to
> whether I send true or false back, it just keeps polling like nothing
> happened.  Here's my block in rollback( ... ); I'm expecting the producer
> (FTP) to stop polling if it gets an exception:
>
> if ( exception != null ) {
>            log.error("Error: " + e.getMessage()); //this message IS logged
> at runtime
>            return false; //do not retry
>        } else
>            return true; //keep going
>

The pollStrategy lets you handle the error at this current polling. By
default the ftp consumer will poll every second. You can change this
interval by setting a delay on the FTP endpoint, to ex ?delay=60000 to
poll once every 60th seconds. The delay is in millis.

If you want to stop the ftp consumer totally you need to stop the route instead.



> --
> View this message in context: 
> http://www.nabble.com/catch-error-in-producer-endpoint-tp25748604p25828094.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

Reply via email to