oscerd opened a new pull request, #26658:
URL: https://github.com/apache/camel/pull/26658

   Manual backport of #26521 (CAMEL-24778) to `camel-4.18.x`.
   
   The backport bot could not auto-port this one — it hit a cherry-pick 
conflict because `KafkaRecordBatchingProcessorCommonHeadersTest` (where the 
regression test lives on `main`) does not exist on this branch (it was added 
later, with CAMEL-20428). The batching NPE itself is present on 4.18.x 
verbatim: `KafkaConfiguration.maxPollRecords` has no initializer, and 
`KafkaRecordBatchingProcessor` unboxes `configuration.getMaxPollRecords()` into 
`new ArrayBlockingQueue<>(...)`, so enabling `batching=true` without setting 
`maxPollRecords` throws a `NullPointerException`.
   
   ## Change
   
   - **Fix (identical to main):** initialize `maxPollRecords = 500`. Streaming 
behaviour is unchanged (Kafka's own default is also 500); the `@UriParam` 
metadata is untouched so no catalog/DSL regeneration is required.
   - **Test (branch-adapted):** the regression test is added as a dedicated 
`KafkaRecordBatchingProcessorTest` (constructs the batching processor with a 
default configuration, which threw the NPE before the fix), because the 
`CommonHeadersTest` file it lives in on `main` is not present on 4.18.x.
   
   Not a straight cherry-pick (the test was adapted to this branch), so 
requesting review per convention. `camel-kafka` module build is green (the new 
test passes).
   
   JIRA: https://issues.apache.org/jira/browse/CAMEL-24778
   
   _Claude Code on behalf of @oscerd_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to