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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • requestToVoid

      public reactor.core.publisher.Mono<Void> requestToVoid(org.springframework.web.service.invoker.HttpRequestValues requestValues)
      Specified by:
      requestToVoid in interface org.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:
      requestToHeaders in interface org.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:
      requestToBody in interface org.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:
      requestToBodyFlux in interface org.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:
      requestToBodilessEntity in interface org.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:
      requestToEntity in interface org.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:
      requestToEntityFlux in interface org.springframework.web.service.invoker.HttpClientAdapter
    • forClient

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