2 Replies Latest reply on Oct 13, 2009 2:56 AM by parasmk

    Catch exception in camel producer endpoint

    parasmk

      Hello

       

      I posted a question in regards to the error/exception handling in Camel producer endpoint (eg. FTP) on nabble which haven't got answered yet ( http://www.nabble.com/catch-error-in-producer-endpoint-td25748604.html ).

       

      I need to transfer files from a FTP server to a local directory and know if the server is down and if so retry every 10 minutes. Maybe smeone of you can hint me if  there is any standard method in Camel to catch exceptions from the producer?  I have tried

      Camel doTry/doCatch, but it catches exceptions when the message is inside the exchange, i.e. after the from() in DSL:

       

      from("ftp:// ...").to("file:// ...")

       

      Thanks a lot in advance.

       

      Any help is greatly appreciated, thx, Paras.<!Session data>

        • 1. Re: Catch exception in camel producer endpoint
          oisin

           

          I need to transfer files from a FTP server to a local directory and know if the server is down and if so retry every 10 minutes

           

           

          Depending on the FTP component implementation, it may not produce exceptions

          when the connect fails - this is a kind of a low-level detail of operation that's

          not available to the route as whole, because it doesn't related to the processing

          of the exchange.

           

          The FTP2 component does allow you

          to specify max number of reconnects and delay between reconnects, and

          this might work for you, e.g add &maximumReconnectAttempts=0&reconnectDelay=600000 to continue retrying with a delay of 10 minutes before reconnecting again.

          • 2. Re: Catch exception in camel producer endpoint
            parasmk

            I received an answer to this questions here: http://www.nabble.com/forum/Reply.jtp?post=25854162

             

            Thank you Camel community!