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

fix(proto): use full range of MetadataRequest #2556

Merged
merged 1 commit into from
Aug 4, 2023
Merged

Conversation

dnwe
Copy link
Collaborator

@dnwe dnwe commented Aug 3, 2023

Even though most of these are identical, we may as well match up correctly.

Contributes-to: #2408

Base automatically changed from dnwe/offset-commit-request to main August 3, 2023 22:12
@@ -17,6 +17,10 @@ func NewMetadataRequest(version KafkaVersion, topics []string) *MetadataRequest
m.Version = 6
} else if version.IsAtLeast(V1_0_0_0) {
m.Version = 5
} else if version.IsAtLeast(V0_11_0_0) {
Copy link
Collaborator

@hindessm hindessm Aug 4, 2023

Choose a reason for hiding this comment

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

FYI: I prefer these else if highest first which makes me dislike those if {}; if {} lowest first additions I queried yesterday even more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@hindessm I agree it's nicer and it works here because there's no mandatory additional fields, just the version number being set.

However, In some of those other cases it (e.g.,) needs a mandatory field included from V4 upward, so an additive approach works better.

One additional thing I did like about Metadata was that it puts the version choice logic alongside the proto definition rather than within client.go / broker.go / consumer.go etc.

@dnwe dnwe force-pushed the dnwe/metadata-request branch 2 times, most recently from f401b55 to 34828a0 Compare August 4, 2023 09:18
Even though most of these are identical, we may as well match up
correctly.

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
@dnwe dnwe merged commit 09ced0b into main Aug 4, 2023
19 checks passed
@dnwe dnwe deleted the dnwe/metadata-request branch August 4, 2023 09:46
@dnwe dnwe added fix feat and removed fix labels Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants