You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/10/26 13:20:38 UTC
[camel] branch main updated (a9aa1fe -> 1b37442)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git.
from a9aa1fe CAMEL-17009: MDC is not cleared when UoW is done.
new d8ddce5 CAMEL-17009: The internal routing engine should propagate the correct async returned boolean so we correctly know if it was processed sync or async.
new 1b37442 CAMEL-17009: The internal routing engine should use sync true when it forces the sync processing in this delegate processor as the code comments says.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../org/apache/camel/impl/engine/CamelInternalProcessor.java | 10 +++++-----
.../apache/camel/support/processor/DelegateSyncProcessor.java | 11 +++++------
2 files changed, 10 insertions(+), 11 deletions(-)
[camel] 01/02: CAMEL-17009: The internal routing engine should
propagate the correct async returned boolean so we correctly know if it was
processed sync or async.
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit d8ddce59efd076c5e7339d265ebc30138e96aa5a
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Oct 26 14:13:10 2021 +0200
CAMEL-17009: The internal routing engine should propagate the correct async returned boolean so we correctly know if it was processed sync or async.
---
.../org/apache/camel/impl/engine/CamelInternalProcessor.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/CamelInternalProcessor.java b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/CamelInternalProcessor.java
index 28bc972..9534ae1 100644
--- a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/CamelInternalProcessor.java
+++ b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/CamelInternalProcessor.java
@@ -396,7 +396,7 @@ public class CamelInternalProcessor extends DelegateAsyncProcessor implements In
if (LOG.isTraceEnabled()) {
LOG.trace("Processing exchange for exchangeId: {} -> {}", exchange.getExchangeId(), exchange);
}
- processor.process(exchange, async);
+ boolean result = processor.process(exchange, async);
// ----------------------------------------------------------
// CAMEL END USER - DEBUG ME HERE +++ END +++
// ----------------------------------------------------------
@@ -404,15 +404,15 @@ public class CamelInternalProcessor extends DelegateAsyncProcessor implements In
// optimize to only do after uow processing if really needed
if (beforeAndAfter) {
// execute any after processor work (in current thread, not in the callback)
- uow.afterProcess(processor, exchange, afterTask, false);
+ uow.afterProcess(processor, exchange, afterTask, result);
}
if (LOG.isTraceEnabled()) {
- LOG.trace("Exchange processed and is continued routed asynchronously for exchangeId: {} -> {}",
+ LOG.trace("Exchange processed and is continued routed {} for exchangeId: {} -> {}",
+ result ? "synchronously" : "asynchronously",
exchange.getExchangeId(), exchange);
}
- // we are done asynchronously - must return false
- return false;
+ return result;
}
}
[camel] 02/02: CAMEL-17009: The internal routing engine should use
sync true when it forces the sync processing in this delegate processor as
the code comments says.
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 1b374423fb9371075184d5ab2d9c3b15015b2334
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Oct 26 15:15:41 2021 +0200
CAMEL-17009: The internal routing engine should use sync true when it forces the sync processing in this delegate processor as the code comments says.
---
.../apache/camel/support/processor/DelegateSyncProcessor.java | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/processor/DelegateSyncProcessor.java b/core/camel-support/src/main/java/org/apache/camel/support/processor/DelegateSyncProcessor.java
index ee64ef1..ad5885c 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/processor/DelegateSyncProcessor.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/processor/DelegateSyncProcessor.java
@@ -30,12 +30,11 @@ import org.apache.camel.support.service.ServiceHelper;
import org.apache.camel.support.service.ServiceSupport;
/**
- * A Delegate pattern which delegates synchronous processing to a nested {@link org.apache.camel.Processor} which can be
- * useful for implementation inheritance when writing an {@link org.apache.camel.spi.Policy}
+ * A delegate pattern which delegates synchronous processing to a nested {@link org.apache.camel.Processor}.
* <p/>
- * <b>Important:</b> This implementation <b>does</b> support the asynchronous routing engine, <b>only</b>. if the logic
+ * <b>Important:</b> This implementation <b>does</b> support the asynchronous routing engine, <b>only</b> if the logic
* in the {@link #process(org.apache.camel.Exchange)} does not invoke EIPs; as it forces using synchronous processing
- * during the {@link #process(org.apache.camel.Exchange)} method call. If you are implementing a EIP pattern please use
+ * during the {@link #process(org.apache.camel.Exchange)} method call. If you are implementing an EIP pattern please use
* this as the delegate, for simple EIPs.
*
* @see DelegateAsyncProcessor
@@ -69,9 +68,9 @@ public class DelegateSyncProcessor extends ServiceSupport
exchange.setException(e);
} finally {
// we are bridging a sync processor as async so callback with true
- callback.done(false);
+ callback.done(true);
}
- return false;
+ return true;
}
@Override