This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 1d7d973 CAMEL-14354: camel-core - Optimize
1d7d973 is described below
commit 1d7d973c0c872a3058ab0d219e6ec46f54c799f1
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Feb 3 21:45:54 2020 +0100
CAMEL-14354: camel-core - Optimize
---
.../errorhandler/RedeliveryErrorHandler.java | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git
a/core/camel-base/src/main/java/org/apache/camel/processor/errorhandler/RedeliveryErrorHandler.java
b/core/camel-base/src/main/java/org/apache/camel/processor/errorhandler/RedeliveryErrorHandler.java
index a0fba2e..c8b0b08 100644
---
a/core/camel-base/src/main/java/org/apache/camel/processor/errorhandler/RedeliveryErrorHandler.java
+++
b/core/camel-base/src/main/java/org/apache/camel/processor/errorhandler/RedeliveryErrorHandler.java
@@ -366,7 +366,15 @@ public abstract class RedeliveryErrorHandler extends
ErrorHandlerSupport impleme
@Override
public void run() {
// can we still run
- if (!isRunAllowed()) {
+ boolean run = true;
+ boolean forceShutdown =
shutdownStrategy.forceShutdown(RedeliveryErrorHandler.this);
+ if (forceShutdown) {
+ run = false;
+ }
+ if (run && isStoppingOrStopped()) {
+ run = false;
+ }
+ if (!run) {
LOG.trace("Run not allowed, will reject executing exchange:
{}", exchange);
if (exchange.getException() == null) {
exchange.setException(new RejectedExecutionException());
@@ -397,17 +405,6 @@ public abstract class RedeliveryErrorHandler extends
ErrorHandlerSupport impleme
}
}
- protected boolean isRunAllowed() {
- // if camel context is forcing a shutdown then do not allow running
- boolean forceShutdown =
shutdownStrategy.forceShutdown(RedeliveryErrorHandler.this);
- if (forceShutdown) {
- return false;
- }
-
- // we cannot run if we are stopping/stopped
- return !isStoppingOrStopped();
- }
-
protected void handleException() {
Exception e = exchange.getException();
// e is never null