This a simple implementation of ClientHttpResponse that levrage JDK 11 HttpClient.

Closes gh-21014

Comment From: pivotal-issuemaster

@Julien-Eyraud Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

Comment From: pivotal-issuemaster

@Julien-Eyraud Thank you for signing the Contributor License Agreement!

Comment From: rstoyanchev

Cross-linking to #17778 that this depends on.

Comment From: rdsubhas

@Julien-Eyraud amazing feature :) would be awesome to resolve conflicts and see this merged...

Comment From: Julien-Eyraud

@rdsubhas I won't fix merge until https://github.com/spring-projects/spring-framework/issues/17778 is fixed

Comment From: candrews

I've created a Spring Boot starter using the code from this PR: https://github.com/candrews/java-httpclient-webclient-spring-boot-starter.

It provides a really simple way to configure WebClient to use Java 11's HttpClient; just add the dependency (which I've published to Maven Central) to your project and you're done.

Hopefully, it helps those of us who really would like this feature hold out until it lands in Spring itself :)

Comment From: curena

So, is this still happening?

Comment From: Julien-Eyraud

I don't know I can update the PR to fix conflict and change the target branch. It's up to the maintainer now.

Comment From: rstoyanchev

The main branch is on JDK 17 now, so we can move forward with this.

Comment From: Julien-Eyraud

I've rebase my branch on main. I've updated the JdkClientHttpResponse#getCookies with a duplicate from JettyClientHttpResponse#parseSameSite. I didn't know where to but it to use a common code. I also updated the documentation.

Comment From: rk99d339

I just saw your JdkClientHttpConnector pullrequest. Please add it here as default if no other is on the classpath org.springframework.web.reactive.function.client.DefaultWebClientBuilder.initConnector() instead of throwing an Exception throw new IllegalStateException("No suitable default ClientHttpConnector found");

A problem is that child classes of AbstractWebClientReactiveOAuth2AccessTokenResponseClient Always creates a new Webclient with: private WebClient webClient = WebClient.builder().build(); which invokes the DefaultWebClientBuilder.initConnector() leading to the IllegalStateException.

Or at least add a Constructor to AbstractWebClientReactiveOAuth2AccessTokenResponseClient which takes a preinitialized WebClient instead of creating a new one.

Sincerely Rolf

Comment From: Julien-Eyraud

It's an interesting point @rk99d339. I'll wait for maintainer feedback. I hope I'll be able to merge soon.

Comment From: Julien-Eyraud

Hi @rstoyanchev do you think I can have a review soon ? Or this will be discard ? What do you think about rk99d339's comment ?

Comment From: rstoyanchev

Yes, I'm reviewing this and should have an update soon.

Comment From: rstoyanchev

This is now in main. I've also made sure the JDK client is used by default when no others are present.