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

camel-cxf - failure processor for custom exception handling cannot get the original message

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.21.0
    • 2.23.3, 2.22.5, 2.24.1, 3.0.0, 2.25.0
    • camel-cxf
    • None
    • Redhat Fuse 7.0 (on EAP)

      reproduced with current "camel-example-cxf-proxy" example

    • Unknown

    Description

      I configured custom exception handling for a CXF consumer where I want to use my own processor.
       
       Lile this:
       
       onException(Exception.class)
                  .handled(false)
                  .useOriginalMessage()
                  .process(failureResponseProcessor);
       
       or:
       
       <onException useOriginalMessage="true">
          <exception>java.lang.Exception</exception>
          <handled><constant>false</constant></handled>
          <process ref="failureResponseProcessor"/>
      </onException>

      If allowStreaming is enabled on the CXF consumer endpoint, my FailureResponseProcessor cannot get the original body (the body part of CachedCxfPayload seems to be empty).

      If I set allowStreaming to false, the processor works as expected.

      I did a branch on my fork to create this reproducer:

      https://github.com/jochenr/camel/tree/Reproducer-CXF-CustomExceptionHandling-in-StreamingMode/examples/camel-example-cxf-proxy

      If you toggle the setting of allowStreaming between true and false, you see the different output to the console, right after the string
      "This was the original BODY that caused the fault:"

      Attachments

        Activity

          People

            ffang Freeman Yue Fang
            j_ri Jochen Riedlinger
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: