public class ServerRSocketConnector extends AbstractRSocketConnector implements ApplicationEventPublisherAware
AbstractRSocketConnector
extension to accept and manage client RSocket connections.
Note: the RSocketFactory.ServerRSocketFactory#acceptor(SocketAcceptor)
in the provided factoryConfigurer
is overridden with an internal IntegrationRSocketAcceptor
for the proper Spring Integration channel adapter mappings.
RSocketFactory.ServerRSocketFactory
rsocketAcceptor
DEFAULT_PHASE
Constructor and Description |
---|
ServerRSocketConnector(reactor.netty.http.server.HttpServer server)
Instantiate a server connector based on the
WebsocketServerTransport . |
ServerRSocketConnector(io.rsocket.transport.ServerTransport<? extends io.rsocket.Closeable> serverTransport)
Instantiate a server connector based on the provided
ServerTransport . |
ServerRSocketConnector(String bindAddress,
int port)
Instantiate a server connector based on the
TcpServerTransport . |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
destroy() |
protected void |
doStart() |
org.springframework.messaging.rsocket.RSocketRequester |
getClientRSocketRequester(Object key) |
Map<Object,org.springframework.messaging.rsocket.RSocketRequester> |
getClientRSocketRequesters() |
void |
setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) |
void |
setClientRSocketKeyStrategy(java.util.function.BiFunction<String,DataBuffer,Object> clientRSocketKeyStrategy)
Configure a strategy to determine a key for the client
RSocketRequester connected. |
void |
setFactoryConfigurer(java.util.function.Consumer<io.rsocket.RSocketFactory.ServerRSocketFactory> factoryConfigurer)
Provide a
Consumer to configure the RSocketFactory.ServerRSocketFactory . |
addEndpoint, afterSingletonsInstantiated, getDataMimeType, getRSocketStrategies, isRunning, setApplicationContext, setDataMimeType, setEndpoints, setRSocketStrategies, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPhase, isAutoStartup, stop
public ServerRSocketConnector(String bindAddress, int port)
TcpServerTransport
.bindAddress
- the local address to bind TCP server onto.port
- the local TCP port to bind.ServerRSocketConnector(ServerTransport)
public ServerRSocketConnector(reactor.netty.http.server.HttpServer server)
WebsocketServerTransport
.server
- the HttpServer
to use.ServerRSocketConnector(ServerTransport)
public ServerRSocketConnector(io.rsocket.transport.ServerTransport<? extends io.rsocket.Closeable> serverTransport)
ServerTransport
.serverTransport
- the ServerTransport
to make server based on.public void setFactoryConfigurer(java.util.function.Consumer<io.rsocket.RSocketFactory.ServerRSocketFactory> factoryConfigurer)
Consumer
to configure the RSocketFactory.ServerRSocketFactory
.factoryConfigurer
- the Consumer
to configure the RSocketFactory.ServerRSocketFactory
.public void setClientRSocketKeyStrategy(java.util.function.BiFunction<String,DataBuffer,Object> clientRSocketKeyStrategy)
RSocketRequester
connected.
Defaults to the destination
the client is connected.clientRSocketKeyStrategy
- the BiFunction
to determine a key for client RSocketRequester
s.public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher
in interface ApplicationEventPublisherAware
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class AbstractRSocketConnector
public Map<Object,org.springframework.messaging.rsocket.RSocketRequester> getClientRSocketRequesters()
@Nullable public org.springframework.messaging.rsocket.RSocketRequester getClientRSocketRequester(Object key)
protected void doStart()
doStart
in class AbstractRSocketConnector
public void destroy()
destroy
in interface DisposableBean