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

Exceptions are not propagated to the parent route when they are thrown from the RecipientList EIP

    XMLWordPrintableJSON

Details

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

    Description

      Here is the unit test to reproduce this 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() {
                  throw new RuntimeException("TestException!");
              }
          }
      
          @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())
                          .recipientList(bean(Router.class));
                  }
              };
          }
      
      }
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: