camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [8/8] git commit: CAMEL-6377: Optimized routing engine to reduce stack frames in use during routing. Work in progress.
Date Tue, 21 May 2013 05:43:57 GMT
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 <davsclaus@apache.org>
Authored: Tue May 21 07:37:29 2013 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
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


Mime
View raw message