MINOR: Warn when Connect sink tasks use the consumer group protocol - #23422
Open
andyhuangdev wants to merge 1 commit into
Open
andyhuangdev wants to merge 1 commit into
andyhuangdev wants to merge 1 commit into
Conversation
Log a warning when a sink task's effective group.protocol is CONSUMER, while preserving the configured value. Test plan: WorkerTest parameterized cases for CONSUMER and CLASSIC with topic creation enabled and disabled (4 passed).
Contributor
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Pull request overview
Adds a production-readiness warning when starting Kafka Connect sink tasks configured with group.protocol=CONSUMER, along with a parameterized test to validate warning/no-warning behavior across protocols.
Changes:
- Log a WARN when a sink task’s consumer is configured with
group.protocol=CONSUMER. - Add a JUnit parameterized test covering sink-task startup across protocol values and topic creation settings.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java | Emits a WARN during sink task consumer construction when group.protocol indicates the CONSUMER protocol. |
| connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerTest.java | Adds parameterized coverage ensuring the warning is logged only for group.protocol=CONSUMER on sink tasks. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1924
to
+1927
| Object groupProtocol = consumerProps.get(ConsumerConfig.GROUP_PROTOCOL_CONFIG); | ||
| if (groupProtocol != null && GroupProtocol.CONSUMER.name().equalsIgnoreCase(groupProtocol.toString())) { | ||
| log.warn("Sink task {} uses group.protocol=CONSUMER, which has not been fully tested for production use with Kafka Connect.", id); | ||
| } |
Comment on lines
+767
to
+769
| warningLogged = appender.getMessages("WARN").stream().anyMatch(message -> message.contains("group.protocol=CONSUMER") | ||
| && message.contains("not been fully tested for production") | ||
| && message.contains(TASK_ID.toString())); |
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.
Warn when a Kafka Connect sink task uses
group.protocol=CONSUMER, since this combination has not been fully tested for production use.This follows the review discussion in PR #23364, which recommends warning users while preserving the existing ability to select the consumer group protocol.
Check the effective consumer configuration in
SinkTaskBuilder.doBuild()after worker settings and connector overrides are merged. Preserve the configured protocol and include the task ID in the warning.Test plan:
CONSUMERand no warnings forCLASSIC, with topic creation enabled and disabled.