You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Manuel Shenavai (Jira)" <ji...@apache.org> on 2024/02/23 10:44:00 UTC
[jira] [Updated] (CAMEL-20457) NullPointerException for Split without AggregationStrategy
[ https://issues.apache.org/jira/browse/CAMEL-20457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Manuel Shenavai updated CAMEL-20457:
------------------------------------
Description:
When using split() without a aggregation strategy, a NPE will be thrown once the timeout has been exceeded.
Coming from Camel 2, there was no timeout method in the Aggregation Interface. Either there should be a default AggregationStrategy or a Null-Check in MulticastProcessor$MulticastTask
Example:
[https://github.com/apache/camel/blob/camel-3.22.x/core/camel-core/src/test/java/org/apache/camel/processor/SplitParallelTimeoutTest.java#L59]
Remove the parameter MyAggregationStrategy and execute the test.
NullPointerException will be thrown:
Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.camel.AggregationStrategy.timeout(org.apache.camel.Exchange, int, int, long)" because "strategy" is null
at org.apache.camel.processor.MulticastProcessor$MulticastTask.timeout(MulticastProcessor.java:474)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
For the multicast, there seems to be a default Aggregation Strategy: [https://github.com/apache/camel/blob/camel-3.22.x/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/MulticastReifier.java#L118]
was:
When using split() without a aggregation strategy, a NPE will be thrown once the timeout has been exceeded.
Coming from Camel 2, there was no timeout method in the Aggregation Interface. Either there should be a default AggregationStrategy or a Null-Check in MulticastProcessor$MulticastTask
Example:
[https://github.com/apache/camel/blob/camel-3.22.x/core/camel-core/src/test/java/org/apache/camel/processor/SplitParallelTimeoutTest.java#L59]
Remove the parameter MyAggregationStrategy and execute the test.
NullPointerException will be thrown:
Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.camel.AggregationStrategy.timeout(org.apache.camel.Exchange, int, int, long)" because "strategy" is null
at org.apache.camel.processor.MulticastProcessor$MulticastTask.timeout(MulticastProcessor.java:474)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
> NullPointerException for Split without AggregationStrategy
> ----------------------------------------------------------
>
> Key: CAMEL-20457
> URL: https://issues.apache.org/jira/browse/CAMEL-20457
> Project: Camel
> Issue Type: Bug
> Affects Versions: 3.22.1
> Reporter: Manuel Shenavai
> Priority: Major
>
> When using split() without a aggregation strategy, a NPE will be thrown once the timeout has been exceeded.
> Coming from Camel 2, there was no timeout method in the Aggregation Interface. Either there should be a default AggregationStrategy or a Null-Check in MulticastProcessor$MulticastTask
> Example:
> [https://github.com/apache/camel/blob/camel-3.22.x/core/camel-core/src/test/java/org/apache/camel/processor/SplitParallelTimeoutTest.java#L59]
> Remove the parameter MyAggregationStrategy and execute the test.
>
> NullPointerException will be thrown:
> Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.camel.AggregationStrategy.timeout(org.apache.camel.Exchange, int, int, long)" because "strategy" is null
> at org.apache.camel.processor.MulticastProcessor$MulticastTask.timeout(MulticastProcessor.java:474)
> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
> at java.base/java.lang.Thread.run(Thread.java:840)
>
> For the multicast, there seems to be a default Aggregation Strategy: [https://github.com/apache/camel/blob/camel-3.22.x/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/MulticastReifier.java#L118]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)