Skip to content

MINOR: Warn when Connect sink tasks use the consumer group protocol - #23422

Open
andyhuangdev wants to merge 1 commit into
apache:trunkfrom
andyhuangdev:minor-connect-consumer-protocol-warning
Open

andyhuangdev wants to merge 1 commit into
apache:trunkfrom
andyhuangdev:minor-connect-consumer-protocol-warning

Conversation

@andyhuangdev

Copy link
Copy Markdown
Contributor

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:

  • Passed 4 parameterized cases covering warnings for CONSUMER and no warnings for CLASSIC, with topic creation enabled and disabled.

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).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()));
@github-actions github-actions Bot removed the triage PRs from the community label Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants