Skip to content

JDK 11 HttpClient integration with WebClient [SPR-16469] #21014

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

Closed
spring-projects-issues opened this issue Feb 5, 2018 · 5 comments
Closed
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: superseded An issue that has been superseded by another type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Feb 5, 2018

Rossen Stoyanchev opened SPR-16469 and commented

According to this blog post the HttpClient "handles request and response bodies as reactive-streams", and it is currently in incubation status, but will be made official in JDK 11 when it will switch to java.net from jdk.incubator.

Given the JDK 11 release dates, this is probably a 5.2 target. However, at present, we need to experiment with the proposed API to see if there any issues in adapting it through a ClientHttpConnector, and raise issues if necessary.

JDK HTTP Client - JEP 321 - Update


Affects: 5.0.3

Issue Links:

0 votes, 6 watchers

@spring-projects-issues
Copy link
Collaborator Author

Sébastien Deleuze commented

A draft prototype can be found at https://github.com/sdeleuze/jdk-http-webclient/.
It is using Reactor EmitterProcessor + Flow to RS passthrough bridge to adapt from Flow.subscriber to Flux.
Integration tests are all green even if more test is required.
To be discussed in our next reactive meeting

@spring-projects-issues
Copy link
Collaborator Author

Sébastien Deleuze commented

Our integration tests are all green with regular HTTP endpoints but not with streaming ones. I have sent a mail to the net-dev mailing list to describe the issue and get a feedback.

@spring-projects-issues
Copy link
Collaborator Author

Sébastien Deleuze commented

Leveraging a PublishingBodySubscriber copy from JDK-8201186, streaming tests pass as well.

Since this feature provides a Publisher based API and allows to have the lifecycle we were expecting (body available just after status and headers), I have added our +1 for this proposal on the mailing list in order to ask inclusion in JDK 11 out of the box.

@sdeleuze
Copy link
Contributor

I have upgraded the prototype to JDK 11 and Spring Framework 5.1, but it seems most tests are broken. Most significant change has been that we now leverage BodyPublishers.fromPublisher, so maybe the issue is on that part. I won't spend more time on that for now since this is not a Spring Framework 5.2 topic anymore, but we will have to fix that at some point.

@rstoyanchev
Copy link
Contributor

I'm marking this superseded by #23432 which seems to be close enough to the prototype here.

@rstoyanchev rstoyanchev added the status: superseded An issue that has been superseded by another label Nov 8, 2019
@rstoyanchev rstoyanchev removed this from the 5.x Backlog milestone Nov 8, 2019
Julien-Eyraud pushed a commit to Julien-Eyraud/spring-framework that referenced this issue Sep 24, 2021
This a simple implementation of ClientHttpResponse that levrage
JDK 11 HttpClient.

Closes spring-projectsgh-21014
rstoyanchev pushed a commit that referenced this issue Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: superseded An issue that has been superseded by another type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants