Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 23159 invoked from network); 4 Aug 2009 07:55:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Aug 2009 07:55:55 -0000 Received: (qmail 10706 invoked by uid 500); 4 Aug 2009 07:56:00 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 10619 invoked by uid 500); 4 Aug 2009 07:56:00 -0000 Mailing-List: contact dev-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 dev@camel.apache.org Received: (qmail 10609 invoked by uid 500); 4 Aug 2009 07:56:00 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 10602 invoked by uid 99); 4 Aug 2009 07:56:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2009 07:56:00 +0000 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; Tue, 04 Aug 2009 07:55:57 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C8606234C04C for ; Tue, 4 Aug 2009 00:55:35 -0700 (PDT) Message-ID: <535834950.1249372535819.JavaMail.jira@brutus> Date: Tue, 4 Aug 2009 00:55:35 -0700 (PDT) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Assigned: (CAMEL-1867) JmsKeyFormatStrategy not used consistently and JmsMessage.getHeader() not returning correct value In-Reply-To: <102832831.1248966753843.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen reassigned CAMEL-1867: ---------------------------------- Assignee: Claus Ibsen > JmsKeyFormatStrategy not used consistently and JmsMessage.getHeader() not returning correct value > ------------------------------------------------------------------------------------------------- > > Key: CAMEL-1867 > URL: https://issues.apache.org/activemq/browse/CAMEL-1867 > Project: Apache Camel > Issue Type: Bug > Components: camel-jms > Affects Versions: 2.0-M3 > Environment: 2.0-M3 > Reporter: Mark White > Assignee: Claus Ibsen > Attachments: JmsPassThroughtJmsKeyFormatStrategyTest.java, log.out, MessageTester.java > > > On entry to a route from a JMS endpoint configured with PassthroughJmsKeyFormatStrategy the headers with underscores (_) are passed through correctly. > However, when any header value in the message is then changed, the original headers are added back into the message using the DefaultJmsKeyFormatStrategy. For example, sending a JMS message with headers; > HEADER_1=VALUE_1 > HEADER_2=VALUE_1 > we do see just these two headers in the message received into the route. > However, if we then set a header value in the route, say HEADER_1=VALUE_2, we now see the headers; > HEADER.1=VALUE_1 > HEADER.2=VALUE_1 > HEADER_1=VALUE_2 > HEADER_2=VALUE_1 > For some reason in the set header process the original message headers and values get added into the message after being passed through the DefaultJmsKeyFormatStrategy. This has the implication of unnecessary duplication of the headers. > Also, when a message header is accessed using the getHeader(key) method it also goes through the DefaultJmsKeyFormatStrategy to decode the key that is passed. > In the example above, if after we have updated 'HEADER_1' to 'VALUE_2', we do; > message.getHeader("HEADER_1") this goes through the DefaultJmsKeyFormatStrategy and actually gets executed as message.getHeader("HEADER.1") which returns VALUE_1 (wrong!). > Note: if instead we lookup the header through message.getHeaders() which returns the all headers in a Map, we can correctly access the 'HEADER_1' key. (Why is getHeader(key) even going through the KeyFormatStrategy anyway if setHeader() isn't?) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.