Class AbstractReactorHttpExchangeAdapter
java.lang.Object
org.springframework.web.service.invoker.AbstractReactorHttpExchangeAdapter
- All Implemented Interfaces:
- HttpClientAdapter,- HttpExchangeAdapter,- ReactorHttpExchangeAdapter
- Direct Known Subclasses:
- WebClientAdapter
public abstract class AbstractReactorHttpExchangeAdapter
extends Object
implements ReactorHttpExchangeAdapter, HttpClientAdapter
Convenient base class for a 
ReactorHttpExchangeAdapter implementation
 adapting to the synchronous HttpExchangeAdapter contract.- Since:
- 6.1
- Author:
- Rossen Stoyanchev
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedProtected constructor, for subclasses.
- 
Method SummaryModifier and TypeMethodDescriptionvoidexchange(HttpRequestValues requestValues) Perform the given request, and release the response content, if any.exchangeForBodilessEntity(HttpRequestValues requestValues) Variant ofHttpExchangeAdapter.exchange(HttpRequestValues)with additional access to the response status and headers.<T> TexchangeForBody(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Perform the given request and decode the response content to the given type.<T> ResponseEntity<T>exchangeForEntity(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Variant ofHttpExchangeAdapter.exchangeForBody(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.exchangeForHeaders(HttpRequestValues requestValues) Perform the given request, release the response content, and return the response headers.Return the configured time to block for the response from an HTTP service method with a synchronous (blocking) method signature.Return the configuredReactiveAdapterRegistry.reactor.core.publisher.Mono<ResponseEntity<Void>>requestToBodilessEntity(HttpRequestValues requestValues) Variant ofHttpClientAdapter.requestToVoid(HttpRequestValues)with additional access to the response status and headers.<T> reactor.core.publisher.Mono<T>requestToBody(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Perform the given request and decode the response content to the given type.<T> reactor.core.publisher.Flux<T>requestToBodyFlux(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Perform the given request and decode the response content to a stream with elements of the given type.<T> reactor.core.publisher.Mono<ResponseEntity<T>>requestToEntity(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Variant ofHttpClientAdapter.requestToBody(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.<T> reactor.core.publisher.Mono<ResponseEntity<reactor.core.publisher.Flux<T>>>requestToEntityFlux(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Variant ofHttpClientAdapter.requestToBodyFlux(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.reactor.core.publisher.Mono<HttpHeaders>requestToHeaders(HttpRequestValues requestValues) Perform the given request, release the response content, and return the response headers.reactor.core.publisher.Mono<Void>requestToVoid(HttpRequestValues requestValues) Perform the given request, and release the response content, if any.voidsetBlockTimeout(Duration blockTimeout) Configure how long to block for the response of an HTTP service method as described ingetBlockTimeout().voidsetReactiveAdapterRegistry(ReactiveAdapterRegistry reactiveAdapterRegistry) Configure theReactiveAdapterRegistryto use.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.service.invoker.HttpClientAdapterasReactorExchangeAdapterMethods inherited from interface org.springframework.web.service.invoker.HttpExchangeAdaptersupportsRequestAttributesMethods inherited from interface org.springframework.web.service.invoker.ReactorHttpExchangeAdapterexchangeForBodilessEntityMono, exchangeForBodyFlux, exchangeForBodyMono, exchangeForEntityFlux, exchangeForEntityMono, exchangeForHeadersMono, exchangeForMono
- 
Constructor Details- 
AbstractReactorHttpExchangeAdapterprotected AbstractReactorHttpExchangeAdapter()Protected constructor, for subclasses.
 
- 
- 
Method Details- 
setReactiveAdapterRegistryConfigure theReactiveAdapterRegistryto use.By default, this is ReactiveAdapterRegistry.getSharedInstance().
- 
getReactiveAdapterRegistryDescription copied from interface:ReactorHttpExchangeAdapterReturn the configuredReactiveAdapterRegistry.- Specified by:
- getReactiveAdapterRegistryin interface- ReactorHttpExchangeAdapter
 
- 
setBlockTimeoutConfigure how long to block for the response of an HTTP service method as described ingetBlockTimeout().
- 
getBlockTimeoutDescription copied from interface:ReactorHttpExchangeAdapterReturn the configured time to block for the response from an HTTP service method with a synchronous (blocking) method signature.By default, not set in which case the behavior depends on connection and request timeout settings of the underlying HTTP client. We recommend configuring timeout values directly on the underlying HTTP client, which provides more control over such settings. - Specified by:
- getBlockTimeoutin interface- ReactorHttpExchangeAdapter
 
- 
exchangeDescription copied from interface:HttpExchangeAdapterPerform the given request, and release the response content, if any.- Specified by:
- exchangein interface- HttpExchangeAdapter
- Parameters:
- requestValues- the request to perform
 
- 
exchangeForHeadersDescription copied from interface:HttpExchangeAdapterPerform the given request, release the response content, and return the response headers.- Specified by:
- exchangeForHeadersin interface- HttpExchangeAdapter
- Parameters:
- requestValues- the request to perform
- Returns:
- the response headers
 
- 
exchangeForBodypublic <T> T exchangeForBody(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Description copied from interface:HttpExchangeAdapterPerform the given request and decode the response content to the given type.- Specified by:
- exchangeForBodyin interface- HttpExchangeAdapter
- Type Parameters:
- T- the type the response is decoded to
- Parameters:
- requestValues- the request to perform
- bodyType- the target type to decode to
- Returns:
- the decoded response body.
 
- 
exchangeForBodilessEntityDescription copied from interface:HttpExchangeAdapterVariant ofHttpExchangeAdapter.exchange(HttpRequestValues)with additional access to the response status and headers.- Specified by:
- exchangeForBodilessEntityin interface- HttpExchangeAdapter
- Returns:
- the response entity with status and headers.
 
- 
exchangeForEntitypublic <T> ResponseEntity<T> exchangeForEntity(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Description copied from interface:HttpExchangeAdapterVariant ofHttpExchangeAdapter.exchangeForBody(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.- Specified by:
- exchangeForEntityin interface- HttpExchangeAdapter
- Returns:
- the response entity with status, headers, and body.
 
- 
requestToVoidDescription copied from interface:HttpClientAdapterPerform the given request, and release the response content, if any.- Specified by:
- requestToVoidin interface- HttpClientAdapter
- Parameters:
- requestValues- the request to perform
- Returns:
- Monothat completes when the request is fully executed and the response content is released.
 
- 
requestToHeadersDescription copied from interface:HttpClientAdapterPerform the given request, release the response content, and return the response headers.- Specified by:
- requestToHeadersin interface- HttpClientAdapter
- Parameters:
- requestValues- the request to perform
- Returns:
- Monothat returns the response headers the request is fully executed and the response content released.
 
- 
requestToBodypublic <T> reactor.core.publisher.Mono<T> requestToBody(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Description copied from interface:HttpClientAdapterPerform the given request and decode the response content to the given type.- Specified by:
- requestToBodyin interface- HttpClientAdapter
- Type Parameters:
- T- the type the response is decoded to
- Parameters:
- requestValues- the request to perform
- bodyType- the target type to decode to
- Returns:
- Monothat returns the decoded response.
 
- 
requestToBodyFluxpublic <T> reactor.core.publisher.Flux<T> requestToBodyFlux(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Description copied from interface:HttpClientAdapterPerform the given request and decode the response content to a stream with elements of the given type.- Specified by:
- requestToBodyFluxin interface- HttpClientAdapter
- Type Parameters:
- T- the type the response is decoded to
- Parameters:
- requestValues- the request to perform
- bodyType- the target stream element type to decode to
- Returns:
- Fluxwith decoded stream elements.
 
- 
requestToBodilessEntitypublic reactor.core.publisher.Mono<ResponseEntity<Void>> requestToBodilessEntity(HttpRequestValues requestValues) Description copied from interface:HttpClientAdapterVariant ofHttpClientAdapter.requestToVoid(HttpRequestValues)with additional access to the response status and headers.- Specified by:
- requestToBodilessEntityin interface- HttpClientAdapter
 
- 
requestToEntitypublic <T> reactor.core.publisher.Mono<ResponseEntity<T>> requestToEntity(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Description copied from interface:HttpClientAdapterVariant ofHttpClientAdapter.requestToBody(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.- Specified by:
- requestToEntityin interface- HttpClientAdapter
 
- 
requestToEntityFluxpublic <T> reactor.core.publisher.Mono<ResponseEntity<reactor.core.publisher.Flux<T>>> requestToEntityFlux(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Description copied from interface:HttpClientAdapterVariant ofHttpClientAdapter.requestToBodyFlux(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.- Specified by:
- requestToEntityFluxin interface- HttpClientAdapter
 
 
-