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

JDK RawHttpClient #11259

Merged
merged 8 commits into from
Nov 8, 2024
Merged

JDK RawHttpClient #11259

merged 8 commits into from
Nov 8, 2024

Conversation

yawkat
Copy link
Member

@yawkat yawkat commented Oct 17, 2024

This PR adds a RawHttpClient implementation in the JDK client. In principle it's not so complicated, but to actually be useful, it needed a streaming reactive ByteBody implementation, which is complicated to implement.

To implement this, I've refactored the StreamingNettyByteBody implementation into a "generic" implementation that is implemented both for the netty ByteBuf/EventLoop approach, and a more traditional ByteBuffer/lock approach for the jdk client.

  • BodySizeLimits, PublisherAsBlocking, UpstreamBalancer, BufferConsumer.Upstream moved from http-netty into http
  • BufferConsumer refactored into a base BufferConsumer interface (http) and a ByteBufConsumer extension (http-netty)
  • Most StreamingNettyByteBody.SharedBuffer code (http-netty) extracted into an abstract BaseSharedBuffer (http) that is also extended for the JDK client

In particular the SharedBuffer refactor is fairly complicated. While the general code remains unchanged, making it work for different buffer types and concurrency models is still a bit complicated.

yawkat added 7 commits October 2, 2024 17:33

Verified

This commit was signed with the committer’s verified signature.
j178 Jo
Draft because I still need to add tests

Verified

This commit was signed with the committer’s verified signature.
j178 Jo
# Conflicts:
#	http-client-core/src/main/java/io/micronaut/http/client/RawHttpClientFactory.java
#	http-client/src/main/java/io/micronaut/http/client/netty/RawHttpRequestWrapper.java
#	http/src/main/java/io/micronaut/http/MutableHttpRequestWrapper.java
@yawkat yawkat added the type: improvement A minor improvement to an existing feature label Oct 17, 2024
@yawkat yawkat added this to the 4.8.0 milestone Oct 17, 2024
Copy link
Contributor

@graemerocher graemerocher left a comment

Choose a reason for hiding this comment

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

Please increase the code coverage and address the sonar warnings.

@yawkat
Copy link
Member Author

yawkat commented Oct 21, 2024

I think the sonar coverage stats are not including the TCK

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
52.3% Coverage on New Code (required ≥ 70%)

See analysis details on SonarCloud

@yawkat yawkat requested review from dstepanov and removed request for dstepanov November 8, 2024 08:19
@yawkat yawkat merged commit 11cb0f0 into 4.8.x Nov 8, 2024
20 of 21 checks passed
@yawkat yawkat deleted the raw-jdk-client branch November 8, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants