Class RSocketInboundGateway
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- Lifecycle,- Phased,- SmartLifecycle,- ComponentSourceAware,- ExpressionCapable,- IntegrationPattern,- IntegrationRSocketEndpoint,- NamedComponent,- IntegrationInboundManagement,- IntegrationManagement,- ManageableLifecycle,- ManageableSmartLifecycle,- TrackableComponent,- ReactiveMessageHandler
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.
- Since:
- 5.2
- Author:
- Artem Bilan
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.integration.gateway.MessagingGatewaySupportMessagingGatewaySupport.ConvertingMessagingTemplateNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields inherited from class org.springframework.integration.gateway.MessagingGatewaySupportmessagingTemplateFields inherited from class org.springframework.integration.endpoint.AbstractEndpointlifecycleLockFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagementMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructorsConstructorDescriptionRSocketInboundGateway(String... pathArg) Instantiate based on the provided path patterns to map this endpoint for incoming RSocket requests.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voiddoStart()Subclasses must implement this method with the start behavior.ObtainRSocketInteractionModels thisReactiveMessageHandleris 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 voidonInit()Subclasses may implement this for initialization logic.voidsetDecodeFluxAsUnit(boolean decodeFluxAsUnit) Configure an option to decode an incomingFluxas a single unit or each its event separately.voidsetInteractionModels(RSocketInteractionModel... interactionModelsArg) Configure a set ofRSocketInteractionModelthis endpoint is mapped onto.voidsetRequestElementClass(Class<?> requestElementClass) Specify a type of payload to be generated when the inbound RSocket request content is read by the encoders.voidsetRequestElementType(ResolvableType requestElementType) Specify the type of payload to be generated when the inbound RSocket request content is read by the converters/encoders.voidsetRSocketConnector(AbstractRSocketConnector rsocketConnector) Provide anAbstractRSocketConnectorreference for an explicit endpoint mapping.voidsetRSocketStrategies(RSocketStrategies rsocketStrategies) Configure anRSocketStrategiesinstead of a default one.Methods inherited from class org.springframework.integration.gateway.MessagingGatewaySupportbuildErrorMessage, buildSendTimer, destroy, doStop, getComponentType, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getIntegrationPatternType, getManagedName, getManagedType, getOverrides, getReplyChannel, getRequestChannel, isLoggingEnabled, isObserved, receive, receive, receiveMessage, receiveMessage, registerMetricsCaptor, registerObservationRegistry, registerReplyMessageCorrelatorIfNecessary, send, sendAndReceive, sendAndReceiveMessage, sendAndReceiveMessageReactive, sendTimer, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setErrorOnTimeout, setLoggingEnabled, setManagedName, setManagedType, setObservationConvention, setReceiverObservationConvention, setReplyChannel, setReplyChannelName, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestChannelName, setRequestMapper, setRequestTimeout, setShouldTrackMethods inherited from class org.springframework.integration.endpoint.AbstractEndpointdoStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagementgetThisAsMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetBeanName, getComponentName
- 
Constructor Details- 
RSocketInboundGatewayInstantiate based on the provided path patterns to map this endpoint for incoming RSocket requests.- Parameters:
- pathArg- the mapping patterns to use.
 
 
- 
- 
Method Details- 
setRSocketStrategiesConfigure anRSocketStrategiesinstead of a default one. Note: ifAbstractRSocketConnectoris provided, then itsRSocketStrategieshave a precedence.- Parameters:
- rsocketStrategies- the- RSocketStrategiesto use.
- See Also:
 
- 
setRSocketConnectorProvide anAbstractRSocketConnectorreference for an explicit endpoint mapping.- Parameters:
- rsocketConnector- the- AbstractRSocketConnectorto use.
 
- 
setInteractionModelsConfigure a set ofRSocketInteractionModelthis endpoint is mapped onto.- Parameters:
- interactionModelsArg- the- RSocketInteractionModels for mapping.
- Since:
- 5.2.2
 
- 
getInteractionModelsDescription copied from interface:IntegrationRSocketEndpointObtainRSocketInteractionModels thisReactiveMessageHandleris going to be mapped onto. Defaults to all theRSocketInteractionModels.- Specified by:
- getInteractionModelsin interface- IntegrationRSocketEndpoint
- Returns:
- the interaction models for mapping.
 
- 
getPathGet an array of the path patterns this endpoint is mapped onto.- Specified by:
- getPathin interface- IntegrationRSocketEndpoint
- Returns:
- the mapping path
 
- 
setRequestElementClassSpecify a type of payload to be generated when the inbound RSocket request content is read by the encoders. By default this value is null which means at runtime any "text" Content-Type will result in String while all others default tobyte[].class.- Parameters:
- requestElementClass- The payload type.
 
- 
setRequestElementTypeSpecify the type of payload to be generated when the inbound RSocket request content is read by the converters/encoders. By default, this value is null which means at runtime any "text" Content-Type will result in String while all others default tobyte[].class.- Parameters:
- requestElementType- The payload type.
 
- 
setDecodeFluxAsUnitpublic void setDecodeFluxAsUnit(boolean decodeFluxAsUnit) Configure an option to decode an incomingFluxas a single unit or each its event separately. Defaults tofalsefor consistency with Spring Messaging@MessageMapping. The targetFluxdecoding logic depends on theDecoderselected. For example aStringDecoderrequires a new line separator to be present in the stream to indicate a byte buffer end.- Parameters:
- decodeFluxAsUnit- decode incoming- Fluxas a single unit or each event separately.
- Since:
- 5.3
- See Also:
 
- 
onInitprotected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
- onInitin class- MessagingGatewaySupport
 
- 
doStartprotected void doStart()Description copied from class:AbstractEndpointSubclasses must implement this method with the start behavior. This method will be invoked while holding theAbstractEndpoint.lifecycleLock.- Overrides:
- doStartin class- MessagingGatewaySupport
 
- 
handleMessage- Specified by:
- handleMessagein interface- ReactiveMessageHandler
 
 
-