Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 39B5717CEF for ; Wed, 14 Jan 2015 10:52:33 +0000 (UTC) Received: (qmail 70879 invoked by uid 500); 14 Jan 2015 10:52:34 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 70840 invoked by uid 500); 14 Jan 2015 10:52:34 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 70831 invoked by uid 99); 14 Jan 2015 10:52:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jan 2015 10:52:34 +0000 Date: Wed, 14 Jan 2015 10:52:34 +0000 (UTC) From: "Willem Jiang (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CAMEL-8005) Simple language produces null for a method call on a header value MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-8005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Willem Jiang resolved CAMEL-8005. --------------------------------- Resolution: Not a Problem > Simple language produces null for a method call on a header value > ----------------------------------------------------------------- > > Key: CAMEL-8005 > URL: https://issues.apache.org/jira/browse/CAMEL-8005 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.14.0 > Environment: Linux apps4u 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux > java version "1.8.0" > Java(TM) SE Runtime Environment (build 1.8.0-b132) > Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode) > Reporter: Andy Bailey > Assignee: Willem Jiang > > Please could you confirm if this is a bug. > It works if the text is sent in the body but not if it is sent in a header. > I hope the test case is self explanatory. > ------- > import org.apache.camel.CamelContext; > import org.apache.camel.builder.RouteBuilder; > import org.apache.camel.component.mock.MockEndpoint; > import org.apache.camel.impl.DefaultCamelContext; > public class CamelBug { > public static void main(String[] args) throws Exception { > CamelContext camelContext = new DefaultCamelContext(); > camelContext.addRoutes(new RouteBuilder() { > @Override > public void configure() throws Exception { > from("direct:test"). > //setBody(simple("body.replace('a','b')")). > setBody(simple("header[text].replace('a','b')")). > > to("mock:test"); > } > }); > camelContext.start(); > camelContext.createProducerTemplate().sendBodyAndHeader("direct:test","","text","replace me"); > MockEndpoint mockEndpoint = > camelContext.getEndpoint("mock:test", MockEndpoint.class); > String replacedMessage = > mockEndpoint.getExchanges().get(0).getIn().getBody(String.class); > > System.out.println(replacedMessage);//gives null > //assertEquals("replbce me", replacedMessage); > } > } -- This message was sent by Atlassian JIRA (v6.3.4#6332)