public class ClientRSocketConnector extends AbstractRSocketConnector
AbstractRSocketConnector
extension to the RSocket connection.RSocketConnector
,
RSocketRequester
rSocketMessageHandler
DEFAULT_PHASE
Constructor and Description |
---|
ClientRSocketConnector(io.rsocket.transport.ClientTransport clientTransport)
Instantiate a connector based on the provided
ClientTransport . |
ClientRSocketConnector(String host,
int port)
Instantiate a connector based on the
TcpClientTransport . |
ClientRSocketConnector(URI uri)
Instantiate a connector based on the
WebsocketClientTransport . |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
afterSingletonsInstantiated() |
void |
connect()
Perform subscription into the RSocket server for incoming requests.
|
void |
destroy() |
protected void |
doStart() |
RSocketRequester |
getRequester()
Return the
RSocketRequester this connector is built on. |
reactor.core.publisher.Mono<RSocketRequester> |
getRSocketRequester()
Deprecated.
since 5.4 in favor of
getRequester() |
void |
setConnectorConfigurer(RSocketConnectorConfigurer connectorConfigurer)
Callback to configure the
ClientRSocketFactory directly. |
void |
setSetupData(Object setupData)
Set the data for the setup payload.
|
void |
setSetupMetadata(Map<Object,MimeType> setupMetadata)
Add metadata to the setup payload.
|
void |
setSetupRoute(String setupRoute)
Set the route for the setup payload.
|
void |
setSetupRouteVariables(Object... setupRouteVars)
Set the variables for route template to expand with.
|
addEndpoint, getDataMimeType, getMetadataMimeType, getRSocketStrategies, isAutoStartup, isRunning, setApplicationContext, setAutoStartup, setDataMimeType, setEndpoints, setMetadataMimeType, setRSocketStrategies, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPhase, stop
public ClientRSocketConnector(String host, int port)
TcpClientTransport
.host
- the TCP host to connect.port
- the TCP port to connect.ClientRSocketConnector(ClientTransport)
public ClientRSocketConnector(URI uri)
WebsocketClientTransport
.uri
- the WebSocket URI to connect.ClientRSocketConnector(ClientTransport)
public ClientRSocketConnector(io.rsocket.transport.ClientTransport clientTransport)
ClientTransport
.clientTransport
- the ClientTransport
to use.RSocketRequester.Builder#transport(ClientTransport)
public void setConnectorConfigurer(RSocketConnectorConfigurer connectorConfigurer)
ClientRSocketFactory
directly.
Note: this class adds extra RSocketConnectorConfigurer
to the
target RSocketRequester
to populate a reference to an internal
RSocketMessageHandler.responder()
.
This overrides possible external
RSocketConnector.acceptor(io.rsocket.SocketAcceptor)
connectorConfigurer
- the RSocketConnectorConfigurer
to
configure the RSocketConnector
.RSocketRequester.Builder#rsocketConnector(RSocketConnectorConfigurer)
public void setSetupRoute(String setupRoute)
setupRoute
- the route to connect to.RSocketRequester.Builder#setupRoute(String, Object...)
public void setSetupRouteVariables(Object... setupRouteVars)
setupRouteVars
- the route to connect to.RSocketRequester.Builder#setupRoute(String, Object...)
public void setSetupMetadata(Map<Object,MimeType> setupMetadata)
setSetupRoute(String)
.setupMetadata
- the map of metadata to use.RSocketRequester.Builder#setupMetadata(Object, MimeType)
public void setSetupData(Object setupData)
setupData
- the data for connect frame.RSocketRequester.Builder#setupData(Object)
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class AbstractRSocketConnector
public void afterSingletonsInstantiated()
afterSingletonsInstantiated
in interface SmartInitializingSingleton
afterSingletonsInstantiated
in class AbstractRSocketConnector
protected void doStart()
doStart
in class AbstractRSocketConnector
public void destroy()
public void connect()
@Deprecated public reactor.core.publisher.Mono<RSocketRequester> getRSocketRequester()
getRequester()
Mono
for the RSocketRequester
.Mono
for the RSocketRequester
.public RSocketRequester getRequester()
RSocketRequester
this connector is built on.RSocketRequester
this connector is built on.