public class RSocketInboundGateway extends MessagingGatewaySupport implements IntegrationRSocketEndpoint
MessagingGatewaySupport implementation for the IntegrationRSocketEndpoint.
Represents an inbound endpoint for RSocket requests.
May be configured with the AbstractRSocketConnector for mapping registration.
Or existing AbstractRSocketConnector bean(s) will perform detection automatically.
An inbound DataBuffer (either single or as a Publisher element) is
converted to the target expected type which can be configured by the
setRequestElementClass(java.lang.Class<?>) or setRequestElementType(ResolvableType).
If it is not configured, then target type is determined by the contentType header:
If it is a text, then target type is String, otherwise - byte[].
An inbound Publisher is used as is in the message to send payload.
It is a target application responsibility to process that payload any possible way.
A reply payload is encoded to the Flux according a type of the payload or a
Publisher element type.
IntegrationManagement.ManagementOverridesmessagingTemplatelifecycleCondition, lifecycleLockEXPRESSION_PARSER, loggerMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEDEFAULT_PHASE| Constructor and Description |
|---|
RSocketInboundGateway(String... pathArg)
Instantiate based on the provided path patterns to map this endpoint for incoming RSocket requests.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doStart()
Subclasses must implement this method with the start behavior.
|
RSocketInteractionModel[] |
getInteractionModels()
Obtain
RSocketInteractionModels
this ReactiveMessageHandler is going to be mapped onto. |
String[] |
getPath()
Get an array of the path patterns this endpoint is mapped onto.
|
reactor.core.publisher.Mono<Void> |
handleMessage(Message<?> requestMessage) |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setInteractionModels(RSocketInteractionModel... interactionModelsArg)
Configure a set of
RSocketInteractionModel this endpoint is mapped onto. |
void |
setRequestElementClass(Class<?> requestElementClass)
Specify a type of payload to be generated when the inbound RSocket request
content is read by the encoders.
|
void |
setRequestElementType(ResolvableType requestElementType)
Specify the type of payload to be generated when the inbound RSocket request
content is read by the converters/encoders.
|
void |
setRSocketConnector(AbstractRSocketConnector rsocketConnector)
Provide an
AbstractRSocketConnector reference for an explicit endpoint mapping. |
void |
setRSocketStrategies(RSocketStrategies rsocketStrategies)
Configure an
RSocketStrategies instead of a default one. |
buildErrorMessage, doStop, getComponentType, getErrorChannel, getErrorMessageAttributes, getManagedName, getManagedType, getMessageCount, getMessageCountLong, getOverrides, getReplyChannel, getRequestChannel, isCountsEnabled, isLoggingEnabled, receive, receive, receiveMessage, receiveMessage, registerReplyMessageCorrelatorIfNecessary, reset, send, sendAndReceive, sendAndReceiveMessage, sendAndReceiveMessageReactive, setCountsEnabled, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setErrorOnTimeout, setLoggingEnabled, setManagedName, setManagedType, setReplyChannel, setReplyChannelName, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestChannelName, setRequestMapper, setRequestTimeout, setShouldTrackdestroy, doStop, getPhase, getRole, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopafterPropertiesSet, 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, waitgetBeanName, getComponentNamemessageCountdestroy, registerMetricsCaptorpublic RSocketInboundGateway(String... pathArg)
pathArg - the mapping patterns to use.public void setRSocketStrategies(RSocketStrategies rsocketStrategies)
RSocketStrategies instead of a default one.
Note: if AbstractRSocketConnector is provided, then its
RSocketStrategies have a precedence.rsocketStrategies - the RSocketStrategies to use.RSocketStrategies.builder()public void setRSocketConnector(AbstractRSocketConnector rsocketConnector)
AbstractRSocketConnector reference for an explicit endpoint mapping.rsocketConnector - the AbstractRSocketConnector to use.public void setInteractionModels(RSocketInteractionModel... interactionModelsArg)
RSocketInteractionModel this endpoint is mapped onto.interactionModelsArg - the RSocketInteractionModels for mapping.public RSocketInteractionModel[] getInteractionModels()
IntegrationRSocketEndpointRSocketInteractionModels
this ReactiveMessageHandler is going to be mapped onto.
Defaults to all the RSocketInteractionModels.getInteractionModels in interface IntegrationRSocketEndpointpublic String[] getPath()
getPath in interface IntegrationRSocketEndpointpublic void setRequestElementClass(Class<?> requestElementClass)
byte[].class.requestElementClass - The payload type.public void setRequestElementType(ResolvableType requestElementType)
byte[].class.requestElementType - The payload type.protected void onInit()
IntegrationObjectSupportonInit in class MessagingGatewaySupportprotected void doStart()
AbstractEndpointAbstractEndpoint.lifecycleLock.doStart in class MessagingGatewaySupportpublic reactor.core.publisher.Mono<Void> handleMessage(Message<?> requestMessage)
handleMessage in interface ReactiveMessageHandler