Skip to content

KAFKA-19042: [1/N] Move ConsumerTopicCreationTest to client-integration-tests module #19283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 31, 2025

Conversation

frankvicky
Copy link
Contributor

@frankvicky frankvicky commented Mar 25, 2025

JIRA: KAFKA-19042

This patch moves ConsumerTopicCreationTest to the client-integration-tests and rewrite it as Java.
The patch also streamlines the test flow.
In the Scala version, there is a producer that produces messages, but this is not the main purpose of the ConsumerTopicCreationTest.

Reviewers: Ken Huang [email protected], Chia-Ping Tsai [email protected]

…ts module

JIRA: KAFKA-19042
This patch moves ConsumerTopicCreationTest to the
client-integration-tests and rewrite it as Java.
@github-actions github-actions bot added triage PRs from the community core Kafka Broker tests Test fixes (including flaky tests) clients labels Mar 25, 2025
Copy link
Collaborator

@m1a2st m1a2st left a comment

Choose a reason for hiding this comment

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

Thanks for this PR, left a comment

Comment on lines 112 to 119
Map<String, Object> consumerConfig = Map.of(
CLIENT_ID_CONFIG, "ConsumerTestConsumer",
GROUP_ID_CONFIG, "TestGroup",
ALLOW_AUTO_CREATE_TOPICS_CONFIG, allowConsumerAutoCreateTopics,
GROUP_PROTOCOL_CONFIG, protocol.name().toLowerCase(Locale.ROOT),
BOOTSTRAP_SERVERS_CONFIG, bootstrapServer
);
return new KafkaConsumer<>(consumerConfig, new ByteArrayDeserializer(), new ByteArrayDeserializer());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should use cluster.consumer() to create consumer.

Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

@frankvicky thanks for this patch. could you please refactor it to eliminate the duplicate code?


private Consumer<byte[], byte[]> createConsumer(ClusterInstance cluster, GroupProtocol protocol, boolean allowConsumerAutoCreateTopics) {
Map<String, Object> consumerConfig = Map.of(
CLIENT_ID_CONFIG, "ConsumerTestConsumer",
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary?

@github-actions github-actions bot removed the triage PRs from the community label Mar 28, 2025
}

private Set<String> getAllTopics(ClusterInstance cluster) {
return cluster.brokers().values().iterator().next().metadataCache().getAllTopics();
Copy link
Member

Choose a reason for hiding this comment

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

Could you please avoid accessing broker? Maybe we can use Admin instead?

@chia7712 chia7712 merged commit 2054693 into apache:trunk Mar 31, 2025
24 checks passed
janchilling pushed a commit to janchilling/kafka that referenced this pull request Apr 4, 2025
…s module (apache#19283)

This patch moves `ConsumerTopicCreationTest` to the
`client-integration-tests` and rewrite it as Java.
The patch also streamlines the test flow. 
In the Scala version, there is a producer that produces messages, but
this is not the main purpose of the `ConsumerTopicCreationTest`.

Reviewers: Ken Huang <[email protected]>, Chia-Ping Tsai
<[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-approved clients core Kafka Broker tests Test fixes (including flaky tests)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants