MessageSupport.copyFrom() doesn't clean the message header and the attachments
------------------------------------------------------------------------------
Key: CAMEL-1955
URL: https://issues.apache.org/activemq/browse/CAMEL-1955
Project: Apache Camel
Issue Type: Bug
Components: camel-core
Affects Versions: 2.0.0, 2.0-M3, 2.0-M2, 1.6.1, 2.0-M1, 1.6.0, 1.5.0
Reporter: Willem Jiang
Assignee: Willem Jiang
Fix For: 1.6.2, 2.1.0
If the we want to clean up the attachment in the pipeline processor, we will
hit this bug.
{code}
from("direct:start")
.process(new Processor() {
public void process(Exchange exchange) throws Exception
{
exchange.getOut().copyFrom(exchange.getIn());
//Added the header and attachment
exchange.getOut().setHeader("test", "testValue");
exchange.getOut().addAttachment("test1.xml", new
DataHandler(new FileDataSource("pom.xml")));
}
})
.process(new Processor() {
public void process(Exchange exchange) throws Exception
{
exchange.getOut().copyFrom(exchange.getIn());
assertNotNull("The test attachment should not be
null", exchange.getOut().getAttachment("test1.xml"));
assertNotNull("The test header should not be null",
exchange.getOut().getHeader("test"));
exchange.getOut().removeAttachment("test1.xml");
exchange.getOut().removeHeader("test");
}
});
{code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.