camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kingjamm <>
Subject Potential bug with setHeader and scripts?
Date Fri, 05 Sep 2008 17:16:30 GMT

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

            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:
Sent from the Camel - Users mailing list archive at

View raw message