public class WebFluxRequestExecutingMessageHandler extends AbstractHttpRequestExecutingMessageHandler
MessageHandler implementation that executes
HTTP requests by delegating to a Reactive WebClient instance.HttpRequestExecutingMessageHandler,
WebClientAbstractReplyProducingMessageHandler.RequestHandlerIntegrationManagement.ManagementOverridesmessagingTemplateEXPRESSION_PARSER, loggerMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
WebFluxRequestExecutingMessageHandler(Expression uriExpression)
Create a handler that will send requests to the provided URI Expression.
|
WebFluxRequestExecutingMessageHandler(Expression uriExpression,
WebClient webClient)
Create a handler that will send requests to the provided URI using a provided WebClient.
|
WebFluxRequestExecutingMessageHandler(String uri)
Create a handler that will send requests to the provided URI.
|
WebFluxRequestExecutingMessageHandler(String uri,
WebClient webClient)
Create a handler that will send requests to the provided URI using a provided WebClient.
|
WebFluxRequestExecutingMessageHandler(URI uri)
Create a handler that will send requests to the provided URI.
|
| Modifier and Type | Method and Description |
|---|---|
protected Object |
exchange(java.util.function.Supplier<URI> uriSupplier,
HttpMethod httpMethod,
HttpEntity<?> httpRequest,
Object expectedResponseType,
Message<?> requestMessage) |
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
void |
setBodyExtractor(BodyExtractor<?,ClientHttpResponse> bodyExtractor)
Specify a
BodyExtractor as an alternative to the expectedResponseType
to allow to get low-level access to the received ClientHttpResponse. |
void |
setPublisherElementType(Class<?> publisherElementType)
Configure a type for a request
Publisher elements. |
void |
setPublisherElementTypeExpression(Expression publisherElementTypeExpression)
Configure a SpEL expression to evaluate a request
Publisher elements type at runtime against
a request message. |
void |
setReplyPayloadToFlux(boolean replyPayloadToFlux)
The boolean flag to identify if the reply payload should be as a
Flux from the response body
or as resolved value from the Mono of the response body. |
doInit, evaluateTypeFromExpression, getReply, handleRequestMessage, isExpectReply, mapHeaders, setCharset, setEncodeUri, setExpectedResponseType, setExpectedResponseTypeExpression, setExpectReply, setExtractPayload, setHeaderMapper, setHttpMethod, setHttpMethodExpression, setTransferCookies, setTrustedSpel, setUriVariableExpressions, setUriVariablesExpressiondoInvokeAdvisedRequestHandler, getBeanClassLoader, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyaddNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadersconfigureMetrics, destroy, getActiveCount, getActiveCountLong, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMetricsCaptor, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, handleMessage, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onComplete, onError, onNext, onSubscribe, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waiterrorCount, handleCountgetBeanName, getComponentNamepublic WebFluxRequestExecutingMessageHandler(URI uri)
uri - The URI.public WebFluxRequestExecutingMessageHandler(String uri)
uri - The URI.public WebFluxRequestExecutingMessageHandler(Expression uriExpression)
uriExpression - The URI expression.public WebFluxRequestExecutingMessageHandler(String uri, @Nullable WebClient webClient)
uri - The URI.webClient - The WebClient to use.public WebFluxRequestExecutingMessageHandler(Expression uriExpression, @Nullable WebClient webClient)
uriExpression - A SpEL Expression that can be resolved against the message object and
BeanFactory.webClient - The WebClient to use.public void setReplyPayloadToFlux(boolean replyPayloadToFlux)
Flux from the response body
or as resolved value from the Mono of the response body.
Defaults to false - simple value is pushed downstream.
Makes sense when expectedResponseType is configured.replyPayloadToFlux - represent reply payload as a Flux or as a value from the Mono.AbstractHttpRequestExecutingMessageHandler.setExpectedResponseType(Class),
AbstractHttpRequestExecutingMessageHandler.setExpectedResponseTypeExpression(Expression)public void setBodyExtractor(BodyExtractor<?,ClientHttpResponse> bodyExtractor)
BodyExtractor as an alternative to the expectedResponseType
to allow to get low-level access to the received ClientHttpResponse.bodyExtractor - the BodyExtractor to use.AbstractHttpRequestExecutingMessageHandler.setExpectedResponseType(Class),
AbstractHttpRequestExecutingMessageHandler.setExpectedResponseTypeExpression(Expression)public void setPublisherElementType(Class<?> publisherElementType)
Publisher elements.publisherElementType - the type of the request Publisher elements.BodyInserters.fromPublisher(Publisher, Class)public void setPublisherElementTypeExpression(Expression publisherElementTypeExpression)
Publisher elements type at runtime against
a request message.publisherElementTypeExpression - the expression to evaluate a type for the request
Publisher elements.BodyInserters.fromPublisher(Publisher, Class),
BodyInserters.fromPublisher(Publisher, ParameterizedTypeReference)public String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class AbstractMessageHandlerprotected Object exchange(java.util.function.Supplier<URI> uriSupplier, HttpMethod httpMethod, HttpEntity<?> httpRequest, Object expectedResponseType, Message<?> requestMessage)
exchange in class AbstractHttpRequestExecutingMessageHandler