Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D98652009F7 for ; Sat, 7 May 2016 19:18:01 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D832A160A02; Sat, 7 May 2016 17:18:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 370961609F6 for ; Sat, 7 May 2016 19:18:01 +0200 (CEST) Received: (qmail 2342 invoked by uid 500); 7 May 2016 17:18:00 -0000 Mailing-List: contact commits-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 commits@camel.apache.org Received: (qmail 2325 invoked by uid 99); 7 May 2016 17:18:00 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 May 2016 17:18:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BA528DFDEC; Sat, 7 May 2016 17:17:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Sat, 07 May 2016 17:17:59 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] camel git commit: CAMEL-9250: Configure AllowUseOriginalMessage to be disabled by default if not in use. archived-at: Sat, 07 May 2016 17:18:02 -0000 Repository: camel Updated Branches: refs/heads/master e27f4f7eb -> 2163d8e84 CAMEL-9250: Configure AllowUseOriginalMessage to be disabled by default if not in use. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/10bc1e05 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/10bc1e05 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/10bc1e05 Branch: refs/heads/master Commit: 10bc1e056588d61476962b3e4c468c593530f913 Parents: e27f4f7 Author: Claus Ibsen Authored: Sat May 7 17:39:14 2016 +0200 Committer: Claus Ibsen Committed: Sat May 7 17:39:14 2016 +0200 ---------------------------------------------------------------------- .../apache/camel/component/jms/JmsMessage.java | 21 ++------------------ 1 file changed, 2 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/10bc1e05/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java ---------------------------------------------------------------------- diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java index c75cdde..fc307fb 100644 --- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java +++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java @@ -161,25 +161,8 @@ public class JmsMessage extends DefaultMessage { } public Object getHeader(String name) { - Object answer = null; - - // we will exclude using JMS-prefixed headers here to avoid strangeness with some JMS providers - // e.g. ActiveMQ returns the String not the Destination type for "JMSReplyTo"! - // only look in jms message directly if we have not populated headers - if (jmsMessage != null && !hasPopulatedHeaders() && !name.startsWith("JMS")) { - try { - // use binding to do the lookup as it has to consider using encoded keys - answer = getBinding().getObjectProperty(jmsMessage, name); - } catch (JMSException e) { - throw new RuntimeExchangeException("Unable to retrieve header from JMS Message: " + name, getExchange(), e); - } - } - // only look if we have populated headers otherwise there are no headers at all - // if we do lookup a header starting with JMS then force a lookup - if (answer == null && (hasPopulatedHeaders() || name.startsWith("JMS"))) { - answer = super.getHeader(name); - } - return answer; + ensureInitialHeaders(); + return super.getHeader(name); } @Override