Class RSocketMessageHandler

All Implemented Interfaces:
Aware, BeanNameAware, InitializingBean, ApplicationContextAware, EmbeddedValueResolverAware, ReactiveMessageHandler

public class RSocketMessageHandler extends MessageMappingMessageHandler
Extension of MessageMappingMessageHandler to handle RSocket requests with @MessageMapping and @ConnectMapping methods, also supporting use of @RSocketExchange.

For server scenarios this class can be declared as a bean in Spring configuration and that would detect @MessageMapping methods in @Controller beans. What beans are checked can be changed through a handlerPredicate. Given an instance of this class, you can then use responder() to obtain a SocketAcceptor adapter to register with the RSocketServer.

For a client, possibly in the same process as a server, consider using the static factory method responder(RSocketStrategies, Object...) to obtain a client responder to be registered via RSocketRequester.Builder.

For @MessageMapping and @RSocketExchange methods, this class automatically determines the RSocket interaction type based on the input and output cardinality of the method. See the "Annotated Responders" section of the Spring Framework reference for more details.

Rossen Stoyanchev, Olga Maciaszek-Sharma