-
Notifications
You must be signed in to change notification settings - Fork 14k
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
KAFKA-17563: Move RequestConvertToJson
to server module
#17223
KAFKA-17563: Move RequestConvertToJson
to server module
#17223
Conversation
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.
@xijiu thanks for this patch.
Could you please move some tests from RequestConvertToJsonTest
to server module? testClientInfoNode
, testAllRequestTypesHandled
, testAllApiVersionsResponseHandled
and testAllResponseTypesHandled
I wonder if we should wait for server to switch to Java 17 before merging this. With Java 17, we will be able to use pattern matching and significantly simplify the logic. The huge list of |
That is a good idea. Not only match pattern but also record type can simplify Kafka code base significantly. Also, I agree to that switch(request.apiKey()) {
case PRODUCE:
return ProduceRequestDataJsonConverter.write(((ProduceRequest) request).data(), request.version(), false);
} That is more graceful and probably have better performance. |
Yes that's also an option. I'd really prefer this or pattern matching over the current code. |
Reviewers: Chia-Ping Tsai <[email protected]>
As title.
Committer Checklist (excluded from commit message)