Class WebClientAdapter
java.lang.Object
org.springframework.web.service.invoker.AbstractReactorHttpExchangeAdapter
org.springframework.web.reactive.function.client.support.WebClientAdapter
- All Implemented Interfaces:
org.springframework.web.service.invoker.HttpExchangeAdapter, org.springframework.web.service.invoker.ReactorHttpExchangeAdapter
public final class WebClientAdapter
extends org.springframework.web.service.invoker.AbstractReactorHttpExchangeAdapter
ReactorHttpExchangeAdapter 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 WebClientAdapterCreate aWebClientAdapterfor the givenWebClientinstance.reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Void>> exchangeForBodilessEntityMono(org.springframework.web.service.invoker.HttpRequestValues requestValues) <T> reactor.core.publisher.Flux<T> exchangeForBodyFlux(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) <T> reactor.core.publisher.Mono<T> exchangeForBodyMono(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>>> exchangeForEntityFlux(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) <T> reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<T>> exchangeForEntityMono(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) reactor.core.publisher.Mono<org.springframework.http.HttpHeaders> exchangeForHeadersMono(org.springframework.web.service.invoker.HttpRequestValues requestValues) reactor.core.publisher.Mono<Void> exchangeForMono(org.springframework.web.service.invoker.HttpRequestValues requestValues) booleanMethods inherited from class org.springframework.web.service.invoker.AbstractReactorHttpExchangeAdapter
exchange, exchangeForBodilessEntity, exchangeForBody, exchangeForEntity, exchangeForHeaders, getBlockTimeout, getReactiveAdapterRegistry, setBlockTimeout, setReactiveAdapterRegistry
-
Method Details
-
supportsRequestAttributes
public boolean supportsRequestAttributes() -
exchangeForMono
public reactor.core.publisher.Mono<Void> exchangeForMono(org.springframework.web.service.invoker.HttpRequestValues requestValues) -
exchangeForHeadersMono
public reactor.core.publisher.Mono<org.springframework.http.HttpHeaders> exchangeForHeadersMono(org.springframework.web.service.invoker.HttpRequestValues requestValues) -
exchangeForBodyMono
public <T> reactor.core.publisher.Mono<T> exchangeForBodyMono(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) -
exchangeForBodyFlux
public <T> reactor.core.publisher.Flux<T> exchangeForBodyFlux(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) -
exchangeForBodilessEntityMono
public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Void>> exchangeForBodilessEntityMono(org.springframework.web.service.invoker.HttpRequestValues requestValues) -
exchangeForEntityMono
public <T> reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<T>> exchangeForEntityMono(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) -
exchangeForEntityFlux
public <T> reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<reactor.core.publisher.Flux<T>>> exchangeForEntityFlux(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) -
create
Create aWebClientAdapterfor the givenWebClientinstance.- Parameters:
webClient- the client to use- Returns:
- the created adapter instance
- Since:
- 6.1
-