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 2023/03/17 15:56:34 UTC
[camel] branch camel-3.18.x updated: [CAMEL-19081] Start a route with aggregation fails due to NPE in AggregateProcessor (#9569)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.18.x by this push:
new 50230027022 [CAMEL-19081] Start a route with aggregation fails due to NPE in AggregateProcessor (#9569)
50230027022 is described below
commit 50230027022504e60774be4f58c82a9e82102977
Author: Radovan Netuka <rn...@redhat.com>
AuthorDate: Fri Mar 17 16:55:35 2023 +0100
[CAMEL-19081] Start a route with aggregation fails due to NPE in AggregateProcessor (#9569)
---
.../camel/processor/aggregate/AggregateProcessor.java | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/core/camel-core-processor/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java b/core/camel-core-processor/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
index 306fbdb8263..16ba0651eaf 100644
--- a/core/camel-core-processor/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
+++ b/core/camel-core-processor/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
@@ -916,14 +916,16 @@ public class AggregateProcessor extends AsyncProcessorSupport
for (String key : keys) {
Exchange exchange = aggregationRepository.get(camelContext, key);
- // grab the timeout value
- long timeout = exchange.getProperty(ExchangePropertyKey.AGGREGATED_TIMEOUT, 0L, long.class);
- if (timeout > 0) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Restoring CompletionTimeout for exchangeId: {} with timeout: {} millis.",
- exchange.getExchangeId(), timeout);
+ if (exchange != null) {
+ // grab the timeout value
+ long timeout = exchange.getProperty(ExchangePropertyKey.AGGREGATED_TIMEOUT, 0L, long.class);
+ if (timeout > 0) {
+ if (LOG.isTraceEnabled()) {
+ LOG.trace("Restoring CompletionTimeout for exchangeId: {} with timeout: {} millis.",
+ exchange.getExchangeId(), timeout);
+ }
+ addExchangeToTimeoutMap(key, exchange, timeout);
}
- addExchangeToTimeoutMap(key, exchange, timeout);
}
}