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 Type
    Method
    Description
    create(WebClient webClient)
    Create a WebClientAdapter for the given WebClient instance.
    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)
     
    boolean
     

    Methods inherited from class org.springframework.web.service.invoker.AbstractReactorHttpExchangeAdapter

    exchange, exchangeForBodilessEntity, exchangeForBody, exchangeForEntity, exchangeForHeaders, getBlockTimeout, getReactiveAdapterRegistry, setBlockTimeout, setReactiveAdapterRegistry

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static WebClientAdapter create(WebClient webClient)
      Create a WebClientAdapter for the given WebClient instance.
      Parameters:
      webClient - the client to use
      Returns:
      the created adapter instance
      Since:
      6.1