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:41:00 UTC

[jira] [Created] (CAMEL-20457) NullPointerException for Split without AggregationStrategy

Manuel Shenavai created CAMEL-20457:
---------------------------------------

             Summary: 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


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)

 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)