fix(kafka): correct MCL batch listener registration and enable batchi…#17430
Open
david-leifker wants to merge 2 commits into
Open
fix(kafka): correct MCL batch listener registration and enable batchi…#17430david-leifker wants to merge 2 commits into
david-leifker wants to merge 2 commits into
Conversation
Contributor
|
Linear: PFP-3898 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
dc71d51 to
427b1a0
Compare
…ng by default The MCL batch listener was not being registered correctly — the endpoint always pointed at the single-record `consume` method and the container factory was never configured for batch mode. This fixes three root causes: 1. Make `consumeBatch` the primary contract on `GenericKafkaListener`, with `consume` as a convenience default that delegates via singleton list. 2. Add a batch-enabled `KafkaListenerContainerFactory` bean (`mclBatchEventConsumer`) and select it when batching is enabled. 3. Override `createListenerEndpoint` in `MCLKafkaListenerRegistrar` to register the `consumeBatch(List)` method when batch mode is active. Additionally, enable MCL and MCP batching by default in docker/profiles for all quickstart and debug deployments. Co-authored-by: Cursor <cursoragent@cursor.com>
427b1a0 to
af7a686
Compare
…solutionException MethodKafkaListenerEndpoint wraps batch delivery in a BatchMessagingMessageListenerAdapter that strips ConsumerRecord wrappers, converting List<ConsumerRecord<K,V>> to List<V> before method invocation. This caused a MethodArgumentResolutionException because the consumeBatch method expects List<ConsumerRecord<String, GenericRecord>>. Introduce BatchKafkaListenerEndpoint — a KafkaListenerEndpoint that sets a BatchMessageListener directly on the container, bypassing the messaging adapter entirely. The BatchMessageListener interface delivers the raw List<ConsumerRecord<K,V>> without stripping wrappers. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Linear: PFP-3902 |
a885bf5 to
4e8e062
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ng by default
The MCL batch listener was not being registered correctly — the endpoint always pointed at the single-record
consumemethod and the container factory was never configured for batch mode. This fixes three root causes:consumeBatchthe primary contract onGenericKafkaListener, withconsumeas a convenience default that delegates via singleton list.KafkaListenerContainerFactorybean (mclBatchEventConsumer) and select it when batching is enabled.createListenerEndpointinMCLKafkaListenerRegistrarto register theconsumeBatch(List)method when batch mode is active.Additionally, enable MCL and MCP batching by default in docker/profiles for all quickstart and debug deployments.