Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-20457

camel-core - NullPointerException for Split parallel and timeout without AggregationStrategy

    XMLWordPrintableJSON

Details

    • Unknown

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              mash-sap Manuel Shenavai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: