Return-Path: Delivered-To: apmail-activemq-camel-dev-archive@locus.apache.org Received: (qmail 54092 invoked from network); 5 Sep 2008 18:24:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Sep 2008 18:24:13 -0000 Received: (qmail 49102 invoked by uid 500); 5 Sep 2008 18:24:11 -0000 Delivered-To: apmail-activemq-camel-dev-archive@activemq.apache.org Received: (qmail 49084 invoked by uid 500); 5 Sep 2008 18:24:11 -0000 Mailing-List: contact camel-dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-dev@activemq.apache.org Received: (qmail 49073 invoked by uid 99); 5 Sep 2008 18:24:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Sep 2008 11:24:11 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Sep 2008 18:23:21 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 95ACA234C1CF for ; Fri, 5 Sep 2008 11:23:52 -0700 (PDT) Message-ID: <903059900.1220639032604.JavaMail.jira@brutus> Date: Fri, 5 Sep 2008 11:23:52 -0700 (PDT) From: "James Mello (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Created: (CAMEL-880) Headers lost when using scriptBuilder to set headers dynamically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Headers lost when using scriptBuilder to set headers dynamically ---------------------------------------------------------------- Key: CAMEL-880 URL: https://issues.apache.org/activemq/browse/CAMEL-880 Project: Apache Camel Issue Type: Bug Components: camel-script Affects Versions: 1.4.0 Reporter: James Mello When running a dynamic script evaluation in a setHeader, the header is lost as the Pipeline chain uses the data from the out body as the source of headers. 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); } The specifics of my setup were: Used spring with the following configuration: exchange.getIn().getBody().getExerciseHighLevelActivity().getActivityType() exchange.getIn().getHeader('activity.type') == 3 exchange.getIn().getBody().getData() != undefined ? exchange.getIn().getBody().getData() : "" I did not test this problem with other exchange types, just the JMS type. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.