Yeah, we need to copy the attachments back. I just filled a JIRA[1] for it.
[1]https://issues.apache.org/jira/browse/CAMEL-7575 -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem On July 3, 2014 at 8:00:24 PM, sabri.bousselmi (infosa...@yahoo.fr) wrote: > I think there is a serious issue when evaluatiog Bean language expression. it > seems like attachments are not copied from the resulting exchage. > very simple case: invoke a methode where you add an attachment to the > exchange, when the evaluation is ending the value of the exchange will be > null. > I debuged in camel source code, the method process Line n:174 did not copie > the attachment, below the source code: > ------------------------------- > // copy the original exchange to avoid side effects on it > Exchange resultExchange = exchange.copy(); > // remove any existing exception in case we do OGNL on the > exception > resultExchange.setException(null); > > // force to use InOut to retrieve the result on the OUT > message > resultExchange.setPattern(ExchangePattern.InOut); > processor.process(resultExchange); > result = resultExchange.getOut().getBody(); > > // propagate properties and headers from result > if (resultExchange.hasProperties()) { > > exchange.getProperties().putAll(resultExchange.getProperties()); > } > if (resultExchange.getOut().hasHeaders()) { > > exchange.getIn().getHeaders().putAll(resultExchange.getOut().getHeaders()); > } > > // propagate exceptions > if (resultExchange.getException() != null) { > exchange.setException(resultExchange.getException()); > } > ------------------------------------------------------------------------- > can you please approve the issue. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Attachments-are-Lost-using-Bean-Language-tp5753283.html > > Sent from the Camel - Users mailing list archive at Nabble.com. >