37
37
import org .springframework .http .client .InterceptingClientHttpRequestFactory ;
38
38
import org .springframework .http .client .JdkClientHttpRequestFactory ;
39
39
import org .springframework .http .client .JettyClientHttpRequestFactory ;
40
+ import org .springframework .http .client .ReactorClientHttpRequestFactory ;
40
41
import org .springframework .http .client .SimpleClientHttpRequestFactory ;
41
42
import org .springframework .http .client .observation .ClientRequestObservationConvention ;
42
43
import org .springframework .http .converter .ByteArrayHttpMessageConverter ;
@@ -75,6 +76,8 @@ final class DefaultRestClientBuilder implements RestClient.Builder {
75
76
76
77
private static final boolean jettyClientPresent ;
77
78
79
+ private static final boolean reactorNettyClientPresent ;
80
+
78
81
private static final boolean jdkClientPresent ;
79
82
80
83
// message factories
@@ -99,6 +102,7 @@ final class DefaultRestClientBuilder implements RestClient.Builder {
99
102
100
103
httpComponentsClientPresent = ClassUtils .isPresent ("org.apache.hc.client5.http.classic.HttpClient" , loader );
101
104
jettyClientPresent = ClassUtils .isPresent ("org.eclipse.jetty.client.HttpClient" , loader );
105
+ reactorNettyClientPresent = ClassUtils .isPresent ("reactor.netty.http.client.HttpClient" , loader );
102
106
jdkClientPresent = ClassUtils .isPresent ("java.net.http.HttpClient" , loader );
103
107
104
108
jackson2Present = ClassUtils .isPresent ("com.fasterxml.jackson.databind.ObjectMapper" , loader ) &&
@@ -463,6 +467,9 @@ else if (httpComponentsClientPresent) {
463
467
else if (jettyClientPresent ) {
464
468
return new JettyClientHttpRequestFactory ();
465
469
}
470
+ else if (reactorNettyClientPresent ) {
471
+ return new ReactorClientHttpRequestFactory ();
472
+ }
466
473
else if (jdkClientPresent ) {
467
474
// java.net.http module might not be loaded, so we can't default to the JDK HttpClient
468
475
return new JdkClientHttpRequestFactory ();
0 commit comments