So trying to figure this out, I looked into the source, and found that if the getOut is not null, the out message is used to set the header in the setHeader processor. Unfortunately in the script engine this block of code always ensures that it's NOT null.
script builder class line 520 of Camel 1.4 ScriptContext context = engine.getContext(); int scope = ScriptContext.ENGINE_SCOPE; context.setAttribute("context", exchange.getContext(), scope); context.setAttribute("exchange", exchange, scope); context.setAttribute("request", exchange.getIn(), scope); context.setAttribute("response", exchange.getOut(), scope); The place were the out message is used is here in the Pipeline class at line 79 if (first) { first = false; } else { nextExchange = createNextExchange(processor, nextExchange); } Is the correct behavior to call the getOut in the scripbuilder with an argument of false or is there something more subtle going on here? -- View this message in context: http://www.nabble.com/Potential-bug-with-setHeader-and-scripts--tp19335805s22882p19335805.html Sent from the Camel - Users mailing list archive at Nabble.com.