camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Chen (JIRA)" <j...@apache.org>
Subject [jira] Created: (CAMEL-1384) ExchangeHelper should respect ExchangePattern.InOptionalOut
Date Wed, 25 Feb 2009 17:55:59 GMT
ExchangeHelper should respect ExchangePattern.InOptionalOut 
------------------------------------------------------------

                 Key: CAMEL-1384
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1384
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 1.6.0
         Environment: ActiveMQ/Camel
            Reporter: Michael Chen


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
{code}//
            Message out = source.getOut(false);
            if (out != null) {
                result.getOut(true).copyFrom(out);
            } else {
                // no results so lets copy the last input
{code}
should be changed to:
{code}//
            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
{code}



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message