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

ExchangeHelper should respect ExchangePattern.InOptionalOut

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.0
    • 2.0-M1
    • camel-core
    • None
    • ActiveMQ/Camel

    Description

      The utility method org.apache.camel.util.ExchangeHelper.copyResults() is use by many core classes. However, this method does not properly support MEP InOptionalOut.

      Assuming in an InOptionalOut exchange, having no out message means just that – no out message should be sent, then the following lines in this method

      //
                  Message out = source.getOut(false);
                  if (out != null) {
                      result.getOut(true).copyFrom(out);
                  } else {
                      // no results so lets copy the last input
      

      should be changed to:

      //
                  Message out = source.getOut(false);
                  if (out != null) {
                      result.getOut(true).copyFrom(out);
                  } else if (result.getPattern() == ExchangePattern.InOptionalOut) {
                      result.setOut(null);
                  } else {
                      // no results so lets copy the last input
      

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              mwc_tonesoft Michael Chen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: