Class WebClientAdapter
java.lang.Object
org.springframework.web.reactive.function.client.support.WebClientAdapter
- All Implemented Interfaces:
org.springframework.web.service.invoker.HttpClientAdapter
public final class WebClientAdapter
extends Object
implements org.springframework.web.service.invoker.HttpClientAdapter
HttpClientAdapter that enables an HttpServiceProxyFactory to
use WebClient for request execution.
Use static factory methods in this class to create an
HttpServiceProxyFactory configured with a given WebClient.
- Since:
- 6.0
- Author:
- Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.web.service.invoker.HttpServiceProxyFactorycreateHttpServiceProxyFactory(WebClient webClient) Deprecated, for removal: This API element is subject to removal in a future version.static org.springframework.web.service.invoker.HttpServiceProxyFactorycreateHttpServiceProxyFactory(WebClient.Builder webClientBuilder) Deprecated, for removal: This API element is subject to removal in a future version.in favor of usingforClient(WebClient)andHttpServiceProxyFactory.builder(HttpClientAdapter)static WebClientAdapterCreate aWebClientAdapterfor the givenWebClientinstance.reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Void>>requestToBodilessEntity(org.springframework.web.service.invoker.HttpRequestValues requestValues) <T> reactor.core.publisher.Mono<T>requestToBody(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) <T> reactor.core.publisher.Flux<T>requestToBodyFlux(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) <T> reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<T>>requestToEntity(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) <T> reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<reactor.core.publisher.Flux<T>>>requestToEntityFlux(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) reactor.core.publisher.Mono<org.springframework.http.HttpHeaders>requestToHeaders(org.springframework.web.service.invoker.HttpRequestValues requestValues) reactor.core.publisher.Mono<Void>requestToVoid(org.springframework.web.service.invoker.HttpRequestValues requestValues)
-
Method Details
-
requestToVoid
public reactor.core.publisher.Mono<Void> requestToVoid(org.springframework.web.service.invoker.HttpRequestValues requestValues) - Specified by:
requestToVoidin interfaceorg.springframework.web.service.invoker.HttpClientAdapter
-
requestToHeaders
public reactor.core.publisher.Mono<org.springframework.http.HttpHeaders> requestToHeaders(org.springframework.web.service.invoker.HttpRequestValues requestValues) - Specified by:
requestToHeadersin interfaceorg.springframework.web.service.invoker.HttpClientAdapter
-
requestToBody
public <T> reactor.core.publisher.Mono<T> requestToBody(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) - Specified by:
requestToBodyin interfaceorg.springframework.web.service.invoker.HttpClientAdapter
-
requestToBodyFlux
public <T> reactor.core.publisher.Flux<T> requestToBodyFlux(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) - Specified by:
requestToBodyFluxin interfaceorg.springframework.web.service.invoker.HttpClientAdapter
-
requestToBodilessEntity
public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Void>> requestToBodilessEntity(org.springframework.web.service.invoker.HttpRequestValues requestValues) - Specified by:
requestToBodilessEntityin interfaceorg.springframework.web.service.invoker.HttpClientAdapter
-
requestToEntity
public <T> reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<T>> requestToEntity(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) - Specified by:
requestToEntityin interfaceorg.springframework.web.service.invoker.HttpClientAdapter
-
requestToEntityFlux
public <T> reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<reactor.core.publisher.Flux<T>>> requestToEntityFlux(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) - Specified by:
requestToEntityFluxin interfaceorg.springframework.web.service.invoker.HttpClientAdapter
-
forClient
Create aWebClientAdapterfor the givenWebClientinstance.- Parameters:
webClient- the client to use- Returns:
- the created adapter instance
-
createHttpServiceProxyFactory
@Deprecated(since="6.0.0-RC1", forRemoval=true) public static org.springframework.web.service.invoker.HttpServiceProxyFactory createHttpServiceProxyFactory(WebClient webClient) Deprecated, for removal: This API element is subject to removal in a future version.in favor of usingforClient(WebClient)andHttpServiceProxyFactory.builder(HttpClientAdapter)Static method to create aHttpServiceProxyFactoryconfigured to use the givenWebClientinstance. Effectively a shortcut for:WebClientAdapter adapter = WebClientAdapter.forClient(webClient); HttpServiceProxyFactory proxyFactory = new HttpServiceProxyFactory(adapter);
- Parameters:
webClient- the client to use- Returns:
- the created
HttpServiceProxyFactoryinstance
-
createHttpServiceProxyFactory
@Deprecated(since="6.0.0-RC1", forRemoval=true) public static org.springframework.web.service.invoker.HttpServiceProxyFactory createHttpServiceProxyFactory(WebClient.Builder webClientBuilder) Deprecated, for removal: This API element is subject to removal in a future version.in favor of usingforClient(WebClient)andHttpServiceProxyFactory.builder(HttpClientAdapter)Variant ofcreateHttpServiceProxyFactory(WebClient)that accepts aWebClient.Builderand uses it to create the client.- Parameters:
webClientBuilder- a builder to create the client to use with- Returns:
- the created
HttpServiceProxyFactoryinstance
-
forClient(WebClient)andHttpServiceProxyFactory.builder(HttpClientAdapter)