Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-16201

Camel: DoTry/DoCatch ignore handler=false in Java DSL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • fuse-6.3-R19-GA
    • fuse-6.3-R17-GA
    • Camel
    • None
    • False
    • False
    • % %
    • Undefined
    • Hide

      Unzip reproducer-doTry.zip in the <FUSE>/quickstarts/cxf then jump in `camel-dotry-issue` and run `mvn test`.

      Show
      Unzip reproducer-doTry.zip in the <FUSE>/quickstarts/cxf then jump in `camel-dotry-issue` and run `mvn test`.

      Camel ignores `handle=false` in nested `dotry/docatch` but only with Java DSL, with XML DSL works as expected.

       

      This works

      <route>
            <from uri="direct:testRouteXML"></from>
            <doTry>
              <doTry>
                <to uri="class:redhat.CXFExceptionProcessor" />
                <doCatch>
                  <exception>java.lang.Exception</exception>
                  <handled>
                    <constant>false</constant>
                  </handled>
                  <log message="docatch XML 1" loggingLevel="INFO" logName="redhat"/>
                  <doTry>
                    <to uri="class:redhat.CXFExceptionProcessor" />
                    <doCatch>
                      <exception>java.lang.Exception</exception>
                      <handled>
                        <constant>false</constant>
                      </handled>
                      <log message="docatch XML 2" loggingLevel="INFO" logName="redhat"/>
                    </doCatch>
                  </doTry>
                </doCatch>
              </doTry>
              <doCatch>
                <exception>java.lang.Exception</exception>
                <handled>
                  <constant>true</constant>
                </handled>
                <log message="docatch XML 3" loggingLevel="INFO" logName="redhat"/>
              </doCatch>
            </doTry>
          </route>
      

      This not

              from("direct:testRouteJAVA")
              .doTry()
                  .doTry()
                      .bean(CXFExceptionProcessor.class)
                  .doCatch(Exception.class)
                      .handled(false)
                      .log(LoggingLevel.INFO,MyRouteBuilder.class.getName(), "docatch 1 JAVA")
                      .doTry()
                          .bean(CXFExceptionProcessor.class)
                      .doCatch(Exception.class)
                          .handled(false)
                          .log(LoggingLevel.INFO,MyRouteBuilder.class.getName(), "docatch 2 JAVA")
                      .endDoTry()
                  .endDoTry()
              .doCatch(Exception.class)
                  .handled(true)
                  .log(LoggingLevel.INFO,MyRouteBuilder.class.getName(), "docatch 3 JAVA")
              .endDoTry();
      

            jondruse@redhat.com Jiri Ondrusek
            rhn-support-agagliar Antonio Gagliardi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: