camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/3] camel git commit: Reduce length of stacktraces
Date Wed, 03 Aug 2016 09:59:09 GMT
Reduce length of stacktraces


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/489c76e2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/489c76e2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/489c76e2

Branch: refs/heads/master
Commit: 489c76e233ab7e30b264694470ed29ce493b0392
Parents: 6c7d596
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Aug 3 11:54:51 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Aug 3 11:54:51 2016 +0200

----------------------------------------------------------------------
 .../camel/processor/RedeliveryErrorHandler.java   | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/489c76e2/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
b/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
index 361f088..847b9c5 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
@@ -19,6 +19,7 @@ package org.apache.camel.processor;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.Callable;
+import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ThreadPoolExecutor;
@@ -35,6 +36,7 @@ import org.apache.camel.Navigate;
 import org.apache.camel.Predicate;
 import org.apache.camel.Processor;
 import org.apache.camel.model.OnExceptionDefinition;
+import org.apache.camel.spi.AsyncProcessorAwaitManager;
 import org.apache.camel.spi.ExchangeFormatter;
 import org.apache.camel.spi.ShutdownPrepared;
 import org.apache.camel.spi.SubUnitOfWorkCallback;
@@ -389,7 +391,21 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport
impleme
             // no output then just return
             return;
         }
-        AsyncProcessorHelper.process(this, exchange);
+
+        // inline org.apache.camel.util.AsyncProcessorHelper.process(org.apache.camel.AsyncProcessor,
org.apache.camel.Exchange)
+        // to optimize and reduce stacktrace lengths
+        final AsyncProcessorAwaitManager awaitManager = exchange.getContext().getAsyncProcessorAwaitManager();
+        final CountDownLatch latch = new CountDownLatch(1);
+        boolean sync = process(exchange, new AsyncCallback() {
+            public void done(boolean doneSync) {
+                if (!doneSync) {
+                    awaitManager.countDown(exchange, latch);
+                }
+            }
+        });
+        if (!sync) {
+            awaitManager.await(exchange, latch);
+        }
     }
 
     /**


Mime
View raw message