You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2024/02/24 07:01:00 UTC

[jira] [Assigned] (CAMEL-20457) camel-core - NullPointerException for Split without AggregationStrategy

     [ https://issues.apache.org/jira/browse/CAMEL-20457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-20457:
-----------------------------------

    Assignee: Claus Ibsen

> camel-core - NullPointerException for Split without AggregationStrategy
> -----------------------------------------------------------------------
>
>                 Key: CAMEL-20457
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20457
>             Project: Camel
>          Issue Type: Bug
>          Components: canel-core
>    Affects Versions: 3.22.1
>            Reporter: Manuel Shenavai
>            Assignee: Claus Ibsen
>            Priority: Major
>
> When using split() without a aggregation strategy, a NPE will be thrown once the timeout has been exceeded.
> Coming from Camel 2 we had not set any AggregationStrategy. With Camel 3 this timeout handling now requires a Aggregation Strategy. 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. Maybe something similar can be done for the split?
> [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)