Skip to content
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

Make JavaCompatiblePartitioner new default #1339

Merged
merged 5 commits into from
May 5, 2022

Conversation

Nevon
Copy link
Collaborator

@Nevon Nevon commented May 2, 2022

The JavaCompatiblePartitioner is renamed DefaultPartitioner. The old DefaultPartitioner becomes LegacyPartitioner.

This is a bit of a spicy one, but the alternatives weren't any better. Originally I removed the default partitioner. This would force people to make an active decision about what partitioner to use, which would be good for people upgrading from an earlier version. Once I started updating tests and docs, I realized how the developer experience becomes really bad for new users. You just want to try out producing some messages, and now you have to learn what the heck a partitioner is? I also see it as a bit futile, since as soon as we release 2.1.0 we'd make the new DefaultPartitioner actually be the default, so anyone going from <2.0.0 to >=2.1.0 would anyway be screwed.

I also considered keeping the JavaCompatiblePartitioner export as an alias of the new DefaultPartitioner, so that people using the JavaCompatiblePartitioner today wouldn't need to do anything, but I figured we're doing a breaking change anyway so why start adding new deprecated stuff already in 2.0.0.

Related to #1013 (comment)

The JavaCompatiblePartitioner is renamed DefaultPartitioner. The old
DefaultPartitioner becomes LegacyPartitioner.
@Nevon Nevon force-pushed the java-compatible-default-partitioner branch from 4f46952 to e411abb Compare May 2, 2022 14:38
@Nevon Nevon mentioned this pull request May 3, 2022
10 tasks
Nevon added 2 commits May 5, 2022 11:08
This is to hopefully avoid people mistakenly using the wrong partitioner
because they're relying on the default. This warning will be removed in
a future version.
@Nevon
Copy link
Collaborator Author

Nevon commented May 5, 2022

Had a discussion with @tulios and settled on a compromise where we print a warning when configuring a producer without specifying a partitioner. This warning only gets logged once for the lifetime of the application, and can be silenced with an environment variable or by specifying which partitioner to use. In a later release we can remove the warning.

This will be replaced by a link to the migration guide once available
@Nevon Nevon force-pushed the java-compatible-default-partitioner branch from 15ba521 to 2c04d91 Compare May 5, 2022 10:54
@Nevon Nevon merged commit 3323145 into master May 5, 2022
@Nevon Nevon deleted the java-compatible-default-partitioner branch May 5, 2022 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant