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

Java RouteBuilder configuring context scoped error handler should not be a fluent builder

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.10.0
    • camel-core
    • None
    • Unknown

    Description

      People may configure code like

      @Override
          protected RouteBuilder createRouteBuilder() throws Exception {
              return new RouteBuilder() {
                  @Override
                  public void configure() throws Exception {
                      errorHandler(defaultErrorHandler())
                          .onException(Exception.class)
                          .redeliveryPolicyRef("redeliveryPolicy")
                          .log(LoggingLevel.ERROR, "Error");
      

      Which is wrong. As the context scoped error handler, should be a void method, so people have to configure the onException in a new method as best practice would be.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            davsclaus Claus Ibsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: