Top Description Fields Constructors Methods
org.springframework.web.service.invoker

public abstract Class AbstractReactorHttpExchangeAdapter

extends Object
implements ReactorHttpExchangeAdapter, HttpClientAdapter
Class Inheritance
All Implemented Interfaces
org.springframework.web.service.invoker.HttpClientAdapter, org.springframework.web.service.invoker.ReactorHttpExchangeAdapter, org.springframework.web.service.invoker.HttpExchangeAdapter
Annotations
@SuppressWarnings:removal
Imports
java.time.Duration, reactor.core.publisher.Flux, .Mono, org.springframework.core.ParameterizedTypeReference, .ReactiveAdapterRegistry, org.springframework.http.HttpHeaders, .ResponseEntity, org.springframework.lang.Nullable, org.springframework.util.Assert

Deprecated

as a consequence of HttpClientAdapter being deprecated. See corresponding docs for further information.

Convenient base class for a ReactorHttpExchangeAdapter implementation adapting to the synchronous HttpExchangeAdapter contract.
Author
Rossen Stoyanchev
Since
6.1

Field Summary

Modifier and TypeField and Description
private Duration
private ReactiveAdapterRegistry

Constructor Summary

AccessConstructor and Description
protected
AbstractReactorHttpExchangeAdapter()

Protected constructor, for subclasses.

Method Summary

Modifier and TypeMethod and Description
public void
exchange(HttpRequestValues
the request to perform
requestValues
)

Implements org.springframework.web.service.invoker.HttpExchangeAdapter.exchange.

Perform the given request, and release the response content, if any.
public ResponseEntity<Void>
public <T> T
exchangeForBody(HttpRequestValues
the request to perform
requestValues
,
ParameterizedTypeReference<T>
the target type to decode to
bodyType
)

Implements org.springframework.web.service.invoker.HttpExchangeAdapter.exchangeForBody.

Perform the given request and decode the response content to the given type.
public <T> ResponseEntity<T>
public HttpHeaders
exchangeForHeaders(HttpRequestValues
the request to perform
requestValues
)

Implements org.springframework.web.service.invoker.HttpExchangeAdapter.exchangeForHeaders.

Perform the given request, release the response content, and return the response headers.
public Duration
getBlockTimeout()

Implements org.springframework.web.service.invoker.ReactorHttpExchangeAdapter.getBlockTimeout.

Return the configured time to block for the response from an HTTP service method with a synchronous (blocking) method signature.
public ReactiveAdapterRegistry
public Mono<ResponseEntity<Void>>
public <T> Mono<T>
requestToBody(HttpRequestValues
the request to perform
requestValues
,
ParameterizedTypeReference<T>
the target type to decode to
bodyType
)

Implements org.springframework.web.service.invoker.HttpClientAdapter.requestToBody.

Perform the given request and decode the response content to the given type.
public <T> Flux<T>
requestToBodyFlux(HttpRequestValues
the request to perform
requestValues
,
ParameterizedTypeReference<T>
the target stream element type to decode to
bodyType
)

Implements org.springframework.web.service.invoker.HttpClientAdapter.requestToBodyFlux.

Perform the given request and decode the response content to a stream with elements of the given type.
public <T> Mono<ResponseEntity<T>>
public <T> Mono<ResponseEntity<Flux<T>>>
public Mono<HttpHeaders>
requestToHeaders(HttpRequestValues
the request to perform
requestValues
)

Implements org.springframework.web.service.invoker.HttpClientAdapter.requestToHeaders.

Perform the given request, release the response content, and return the response headers.
public Mono<Void>
requestToVoid(HttpRequestValues
the request to perform
requestValues
)

Implements org.springframework.web.service.invoker.HttpClientAdapter.requestToVoid.

Perform the given request, and release the response content, if any.
public void
setBlockTimeout(Duration blockTimeout)

Configure how long to block for the response of an HTTP service method as described in getBlockTimeout().

public void
setReactiveAdapterRegistry(ReactiveAdapterRegistry reactiveAdapterRegistry)

Configure the ReactiveAdapterRegistry to use.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

blockTimeoutback to summary
private Duration blockTimeout
Annotations
@Nullable
reactiveAdapterRegistryback to summary
private ReactiveAdapterRegistry reactiveAdapterRegistry

Constructor Detail

AbstractReactorHttpExchangeAdapterback to summary
protected AbstractReactorHttpExchangeAdapter()

Protected constructor, for subclasses.

Method Detail

exchangeback to summary
public void exchange(HttpRequestValues requestValues)

Implements org.springframework.web.service.invoker.HttpExchangeAdapter.exchange.

Doc from org.springframework.web.service.invoker.HttpExchangeAdapter.exchange.

Perform the given request, and release the response content, if any.

Parameters
requestValues:HttpRequestValues

the request to perform

Annotations
@Override
exchangeForBodilessEntityback to summary
public ResponseEntity<Void> exchangeForBodilessEntity(HttpRequestValues requestValues)

Implements org.springframework.web.service.invoker.HttpExchangeAdapter.exchangeForBodilessEntity.

Doc from org.springframework.web.service.invoker.HttpExchangeAdapter.exchangeForBodilessEntity.

Variant of exchange(HttpRequestValues) with additional access to the response status and headers.

Returns:ResponseEntity<Void>

the response entity with status and headers.

Annotations
@Override
exchangeForBodyback to summary
public <T> T exchangeForBody(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType)

Implements org.springframework.web.service.invoker.HttpExchangeAdapter.exchangeForBody.

Doc from org.springframework.web.service.invoker.HttpExchangeAdapter.exchangeForBody.

Perform the given request and decode the response content to the given type.

Parameters
<T>
the type the response is decoded to
requestValues:HttpRequestValues

the request to perform

bodyType:ParameterizedTypeReference<T>

the target type to decode to

Returns:T

the decoded response body.

Annotations
@Override
exchangeForEntityback to summary
public <T> ResponseEntity<T> exchangeForEntity(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType)

Implements org.springframework.web.service.invoker.HttpExchangeAdapter.exchangeForEntity.

Doc from org.springframework.web.service.invoker.HttpExchangeAdapter.exchangeForEntity.

Variant of exchangeForBody(HttpRequestValues, ParameterizedTypeReference) with additional access to the response status and headers.

Returns:ResponseEntity<T>

the response entity with status, headers, and body.

Annotations
@Override
exchangeForHeadersback to summary
public HttpHeaders exchangeForHeaders(HttpRequestValues requestValues)

Implements org.springframework.web.service.invoker.HttpExchangeAdapter.exchangeForHeaders.

Doc from org.springframework.web.service.invoker.HttpExchangeAdapter.exchangeForHeaders.

Perform the given request, release the response content, and return the response headers.

Parameters
requestValues:HttpRequestValues

the request to perform

Returns:HttpHeaders

the response headers

Annotations
@Override
getBlockTimeoutback to summary
public Duration getBlockTimeout()

Implements org.springframework.web.service.invoker.ReactorHttpExchangeAdapter.getBlockTimeout.

Doc from org.springframework.web.service.invoker.ReactorHttpExchangeAdapter.getBlockTimeout.

Return 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.

Annotations
@Override
@Nullable
getReactiveAdapterRegistryback to summary
public ReactiveAdapterRegistry getReactiveAdapterRegistry()

Implements org.springframework.web.service.invoker.ReactorHttpExchangeAdapter.getReactiveAdapterRegistry.

Doc from org.springframework.web.service.invoker.ReactorHttpExchangeAdapter.getReactiveAdapterRegistry.

Return the configured ReactiveAdapterRegistry.

Annotations
@Override
requestToBodilessEntityback to summary
public Mono<ResponseEntity<Void>> requestToBodilessEntity(HttpRequestValues requestValues)

Implements org.springframework.web.service.invoker.HttpClientAdapter.requestToBodilessEntity.

Doc from org.springframework.web.service.invoker.HttpClientAdapter.requestToBodilessEntity.

Variant of requestToVoid(HttpRequestValues) with additional access to the response status and headers.

Annotations
@Override
requestToBodyback to summary
public <T> Mono<T> requestToBody(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType)

Implements org.springframework.web.service.invoker.HttpClientAdapter.requestToBody.

Doc from org.springframework.web.service.invoker.HttpClientAdapter.requestToBody.

Perform the given request and decode the response content to the given type.

Parameters
<T>
the type the response is decoded to
requestValues:HttpRequestValues

the request to perform

bodyType:ParameterizedTypeReference<T>

the target type to decode to

Returns:Mono<T>

Mono that returns the decoded response.

Annotations
@Override
requestToBodyFluxback to summary
public <T> Flux<T> requestToBodyFlux(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType)

Implements org.springframework.web.service.invoker.HttpClientAdapter.requestToBodyFlux.

Doc from org.springframework.web.service.invoker.HttpClientAdapter.requestToBodyFlux.

Perform the given request and decode the response content to a stream with elements of the given type.

Parameters
<T>
the type the response is decoded to
requestValues:HttpRequestValues

the request to perform

bodyType:ParameterizedTypeReference<T>

the target stream element type to decode to

Returns:Flux<T>

Flux with decoded stream elements.

Annotations
@Override
requestToEntityback to summary
public <T> Mono<ResponseEntity<T>> requestToEntity(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType)

Implements org.springframework.web.service.invoker.HttpClientAdapter.requestToEntity.

Doc from org.springframework.web.service.invoker.HttpClientAdapter.requestToEntity.

Variant of requestToBody(HttpRequestValues, ParameterizedTypeReference) with additional access to the response status and headers.

Annotations
@Override
requestToEntityFluxback to summary
public <T> Mono<ResponseEntity<Flux<T>>> requestToEntityFlux(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType)

Implements org.springframework.web.service.invoker.HttpClientAdapter.requestToEntityFlux.

Doc from org.springframework.web.service.invoker.HttpClientAdapter.requestToEntityFlux.

Variant of requestToBodyFlux(HttpRequestValues, ParameterizedTypeReference) with additional access to the response status and headers.

Annotations
@Override
requestToHeadersback to summary
public Mono<HttpHeaders> requestToHeaders(HttpRequestValues requestValues)

Implements org.springframework.web.service.invoker.HttpClientAdapter.requestToHeaders.

Doc from org.springframework.web.service.invoker.HttpClientAdapter.requestToHeaders.

Perform the given request, release the response content, and return the response headers.

Parameters
requestValues:HttpRequestValues

the request to perform

Returns:Mono<HttpHeaders>

Mono that returns the response headers the request is fully executed and the response content released.

Annotations
@Override
requestToVoidback to summary
public Mono<Void> requestToVoid(HttpRequestValues requestValues)

Implements org.springframework.web.service.invoker.HttpClientAdapter.requestToVoid.

Doc from org.springframework.web.service.invoker.HttpClientAdapter.requestToVoid.

Perform the given request, and release the response content, if any.

Parameters
requestValues:HttpRequestValues

the request to perform

Returns:Mono<Void>

Mono that completes when the request is fully executed and the response content is released.

Annotations
@Override
setBlockTimeoutback to summary
public void setBlockTimeout(Duration blockTimeout)

Configure how long to block for the response of an HTTP service method as described in getBlockTimeout().

setReactiveAdapterRegistryback to summary
public void setReactiveAdapterRegistry(ReactiveAdapterRegistry reactiveAdapterRegistry)

Configure the ReactiveAdapterRegistry to use.

By default, this is ReactiveAdapterRegistry#getSharedInstance().