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

Exceptions are not propagated to the parent route when endpoint cannot be resolved in the RoutingSlip EIP

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.8.1
    • 2.8.2, 2.9.0
    • camel-core
    • None
    • Unknown

    Description

      Here is the unit test to reproduce the issue

      package org.test;
      
      import org.apache.camel.builder.RouteBuilder;
      import org.apache.camel.component.mock.MockEndpoint;
      import org.apache.camel.test.junit4.CamelTestSupport;
      import org.junit.Test;
      
      public class RecipientListTest extends CamelTestSupport {
      
          public static class Router {
              public String findEndpoint() {
                  return "unresolved://endpoint";
              }
          }
      
          @Test
          public void recipientList() throws Exception {
              MockEndpoint endpoint = getMockEndpoint("mock://error");
              endpoint.expectedMessageCount(1);
      
              sendBody("direct://parent", "Hello World!");
      
              assertMockEndpointsSatisfied();
          }
      
          @Override
          protected RouteBuilder createRouteBuilder() throws Exception {
              return new RouteBuilder() {
                  @Override
                  public void configure() throws Exception {
                      from("direct://parent")
                          .onException(Throwable.class)
                              .to("mock://error")
                          .end()
                          .to("direct://child");
      
                      from("direct://child")
                          .errorHandler(noErrorHandler())
                          .routingSlip(bean(Router.class));
                  }
              };
          }
      
      }
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: