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

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

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.10.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: