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

KREST-5711 - Non-negative partition id for produce #1136

Merged
merged 2 commits into from Mar 24, 2023
Merged

Conversation

AndrewJSchofield
Copy link
Member

The produce API endpoint can be used with or without specifying a partition ID. If a partition ID is specified, it must be non-negative. Before this change, a negative partition ID would result in an exception from the constructor for ProducerRecord which was translated into HTTP 500. But because it's a result of an incorrect request, it should be HTTP 4xx.

The change validates that a supplied partition ID is indeed non-negative before going anywhere near Kafka. The HTTP status code for a negative partition ID is 404.

@AndrewJSchofield AndrewJSchofield requested a review from a team as a code owner March 23, 2023 21:08
@jonchiu
Copy link
Member

jonchiu commented Mar 24, 2023

@AndrewJSchofield is there a test for this

Copy link
Member

@trnguyencflt trnguyencflt left a comment

Choose a reason for hiding this comment

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

LGTM

@AndrewJSchofield AndrewJSchofield merged commit 6e8d2d1 into master Mar 24, 2023
3 checks passed
@AndrewJSchofield AndrewJSchofield deleted the KREST-5711 branch March 24, 2023 11:04
@msn-tldr
Copy link
Member

lgtm

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.

None yet

4 participants