I'm working on a custom processor that is supposed to take a message in,
convert it, and send the results out. The problem I'm running into is that
unless I do things a specific way, it looks like the headers on the source
message get dropped. For example, to create an outbound message, I have to
do this:
String input = ...(modified text)
exchange.getOut().setBody(input);
exchange.getOut().setHeaders(exchange.getIn().getHeaders());

Is there something I'm missing here that's obvious, specifically a way to
simplify this? I think I may be doing unnecessary work in copying the
headers, and that there may be an easier way. SHould I just work with the
"in" message and modify it, or am I correct in working with the "out"
message, assuming that the "in" is immutable? In my case, it's very
important that I retain the original message's headers.

I've also noticed that some of the camel components, specifically the
velocity one, have a tendency to drop headers. For example, if I try to wire
a velocity processor into a chain that leads to an eventual output file, my
filename header gets dropped if it's added earlier in the chain.


-- 
View this message in context: 
http://www.nabble.com/Question-about-use-of-%22in%22-and-%22out%22-messages-in-exchange-tp18121161s22882p18121161.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to