Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9069

Add processor to immediately handle exception while in retry loop

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.17.0
    • camel-core
    • None
    • Unknown

    Description

      We have a recipientList of http4 endpoints. Occasionally an endpoint won't be available, and will return an exception (whether a ConnectException, or any other ex and a status code of >=400). To handle these errors we can use a defaultErrorHandler or leverage onException, and setup redelivery. What we then would like to do is some custom error handling on each occurrence of an exception.

      Both the defaultErrorHandler and onException support .onRedelivery(). While this is nice, when a retry delay grows large enough the lag between the exception and the .onRedelivery() call really begins to grow and so our custom error handling isn't as much “on error” as it is “on error and after a wait”.

      onException also supports a .process() call, however this only occurs once all redeliveries have failed.

      What would be ideal would be an additional .onExceptionOccur(Processor processor) method (or some such name) that allows for immediate processing upon an exception, even if its being handled within a retry loop.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            kevintelford Kevin Telford
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: