Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A53D2DEC6 for ; Tue, 21 May 2013 05:43:52 +0000 (UTC) Received: (qmail 51016 invoked by uid 500); 21 May 2013 05:43:52 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 50914 invoked by uid 500); 21 May 2013 05:43:52 -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 50846 invoked by uid 99); 21 May 2013 05:43:51 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 May 2013 05:43:51 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9F9EB890E33; Tue, 21 May 2013 05:43:50 +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: Tue, 21 May 2013 05:43:57 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [8/8] git commit: CAMEL-6377: Optimized routing engine to reduce stack frames in use during routing. Work in progress. CAMEL-6377: Optimized routing engine to reduce stack frames in use during routing. Work in progress. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/44086237 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/44086237 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/44086237 Branch: refs/heads/master Commit: 4408623727f089637754ac8d36b2907991a620ba Parents: e80810f Author: Claus Ibsen Authored: Tue May 21 07:37:29 2013 +0200 Committer: Claus Ibsen Committed: Tue May 21 07:43:39 2013 +0200 ---------------------------------------------------------------------- .../java/org/apache/camel/impl/MDCUnitOfWork.java | 33 +-------------- camel-core/src/test/resources/log4j.properties | 2 +- 2 files changed, 3 insertions(+), 32 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/44086237/camel-core/src/main/java/org/apache/camel/impl/MDCUnitOfWork.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/impl/MDCUnitOfWork.java b/camel-core/src/main/java/org/apache/camel/impl/MDCUnitOfWork.java index 62f6b16..6565887 100644 --- a/camel-core/src/main/java/org/apache/camel/impl/MDCUnitOfWork.java +++ b/camel-core/src/main/java/org/apache/camel/impl/MDCUnitOfWork.java @@ -184,46 +184,17 @@ public class MDCUnitOfWork extends DefaultUnitOfWork { private static final class MDCCallback implements AsyncCallback { private final AsyncCallback delegate; - private final String breadcrumbId; - private final String exchangeId; - private final String messageId; - private final String correlationId; private final String routeId; - private final String camelContextId; private MDCCallback(AsyncCallback delegate) { this.delegate = delegate; - this.exchangeId = MDC.get(MDC_EXCHANGE_ID); - this.messageId = MDC.get(MDC_MESSAGE_ID); - this.breadcrumbId = MDC.get(MDC_BREADCRUMB_ID); - this.correlationId = MDC.get(MDC_CORRELATION_ID); - this.camelContextId = MDC.get(MDC_CAMEL_CONTEXT_ID); + // we only need to keep track of route id as we may change routes during routing this.routeId = MDC.get(MDC_ROUTE_ID); } public void done(boolean doneSync) { try { - if (!doneSync) { - // when done asynchronously then restore information from previous thread - if (breadcrumbId != null) { - MDC.put(MDC_BREADCRUMB_ID, breadcrumbId); - } - if (exchangeId != null) { - MDC.put(MDC_EXCHANGE_ID, exchangeId); - } - if (messageId != null) { - MDC.put(MDC_MESSAGE_ID, messageId); - } - if (correlationId != null) { - MDC.put(MDC_CORRELATION_ID, correlationId); - } - if (routeId != null) { - MDC.put(MDC_ROUTE_ID, routeId); - } - if (camelContextId != null) { - MDC.put(MDC_CAMEL_CONTEXT_ID, camelContextId); - } - } + MDC.put(MDC_ROUTE_ID, routeId); } finally { // muse ensure delegate is invoked delegate.done(doneSync); http://git-wip-us.apache.org/repos/asf/camel/blob/44086237/camel-core/src/test/resources/log4j.properties ---------------------------------------------------------------------- diff --git a/camel-core/src/test/resources/log4j.properties b/camel-core/src/test/resources/log4j.properties index 21ecb02..55b0834 100644 --- a/camel-core/src/test/resources/log4j.properties +++ b/camel-core/src/test/resources/log4j.properties @@ -59,7 +59,7 @@ log4j.appender.out=org.apache.log4j.ConsoleAppender log4j.appender.out.layout=org.apache.log4j.PatternLayout log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n # MDC -#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.breadcrumbId} - %-10.10X{camelexchangeId} - %-10.10X{camel.correlationId} - %-10.10X{camel.routeId} - %m%n +#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.breadcrumbId} - %-10.10X{camel.exchangeId} - %-10.10X{camel.correlationId} - %-10.10X{camel.routeId} - %m%n # File appender log4j.appender.file=org.apache.log4j.FileAppender