-
Notifications
You must be signed in to change notification settings - Fork 14
Minor Java cleanups: #160
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
base: main
Are you sure you want to change the base?
Minor Java cleanups: #160
Conversation
mimaison
commented
Oct 13, 2025
- Use Admin instead of AdminClient
- Use Map.of/List.of instead of Collections/Arrays
- Use constants for Kafka client configs
- Remove ZooKeeper mentions
- Clean some Javadoc
- Use Admin instead of AdminClient - Use Map.of/List.of instead of Collections/Arrays - Use constants for Kafka client configs - Remove ZooKeeper mentions - Clean some Javadoc Signed-off-by: Mickael Maison <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mimaison, I have one question. Anyway, it looks good.
ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, systemUnderTest.getBootstrapServers(), | ||
ConsumerConfig.GROUP_ID_CONFIG, "tc-" + UUID.randomUUID(), | ||
ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, OffsetResetStrategy.EARLIEST.name().toLowerCase(Locale.ROOT) | ||
ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OffsetResetStrategy
is deprecated since 4.0: https://kafka.apache.org/41/javadoc/org/apache/kafka/clients/consumer/OffsetResetStrategy.html.
There seems to be an issue as the recommended replacement AutoOffsetResetStrategy
is not part of the public API. Tracking that in upstream Kafka.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it does feel like something slipped through the design cracks => I mean deprecating
OffsetResetStrategy makes sense, but introducing AutoOffsetResetStrategy without exposing it in the public API kind of defeats the purpose. So the plan would be to add AutoOffsetResetStrategy
to the public API or from now we would use pure strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the plan is to keep OffsetResetStrategy
deprecated and not advertise AutoOffsetResetStrategy
in the javadoc as it's for internal usages only. So users will now need to hard code earliest
/latest
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mimaison 👍 .