Class ClientRSocketConnector
java.lang.Object
org.springframework.integration.rsocket.AbstractRSocketConnector
org.springframework.integration.rsocket.ClientRSocketConnector
- All Implemented Interfaces:
Aware
,DisposableBean
,InitializingBean
,SmartInitializingSingleton
,ApplicationContextAware
,Lifecycle
,Phased
,SmartLifecycle
A client
AbstractRSocketConnector
extension to the RSocket connection.- Since:
- 5.2
- Author:
- Artem Bilan
- See Also:
-
RSocketConnector
RSocketRequester
-
Field Summary
Fields inherited from class org.springframework.integration.rsocket.AbstractRSocketConnector
rSocketMessageHandler
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ConstructorDescriptionClientRSocketConnector
(io.rsocket.transport.ClientTransport clientTransport) Instantiate a connector based on the providedClientTransport
.ClientRSocketConnector
(String host, int port) Instantiate a connector based on theTcpClientTransport
.Instantiate a connector based on theWebsocketClientTransport
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
connect()
Perform subscription into the RSocket server for incoming requests.void
destroy()
protected void
doStart()
Return theRSocketRequester
this connector is built on.void
setConnectorConfigurer
(RSocketConnectorConfigurer connectorConfigurer) Callback to configure theClientRSocketFactory
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.Methods inherited from class org.springframework.integration.rsocket.AbstractRSocketConnector
addEndpoint, getDataMimeType, getMetadataMimeType, getRSocketStrategies, isAutoStartup, isRunning, setApplicationContext, setAutoStartup, setDataMimeType, setEndpoints, setMetadataMimeType, setRSocketStrategies, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.SmartLifecycle
getPhase, stop
-
Constructor Details
-
ClientRSocketConnector
Instantiate a connector based on theTcpClientTransport
.- Parameters:
host
- the TCP host to connect.port
- the TCP port to connect.- See Also:
-
ClientRSocketConnector
Instantiate a connector based on theWebsocketClientTransport
.- Parameters:
uri
- the WebSocket URI to connect.- See Also:
-
ClientRSocketConnector
public ClientRSocketConnector(io.rsocket.transport.ClientTransport clientTransport) Instantiate a connector based on the providedClientTransport
.- Parameters:
clientTransport
- theClientTransport
to use.- See Also:
-
-
Method Details
-
setConnectorConfigurer
Callback to configure theClientRSocketFactory
directly. Note: this class adds extraRSocketConnectorConfigurer
to the targetRSocketRequester
to populate a reference to an internalRSocketMessageHandler.responder()
. This overrides possible externalRSocketConnector.acceptor(io.rsocket.SocketAcceptor)
- Parameters:
connectorConfigurer
- theRSocketConnectorConfigurer
to configure theRSocketConnector
.- Since:
- 5.2.6
- See Also:
-
setSetupRoute
Set the route for the setup payload.- Parameters:
setupRoute
- the route to connect to.- See Also:
-
setSetupRouteVariables
Set the variables for route template to expand with.- Parameters:
setupRouteVars
- the route to connect to.- See Also:
-
setSetupMetadata
Add metadata to the setup payload. Composite metadata must be in use if this is called more than once or in addition tosetSetupRoute(String)
.- Parameters:
setupMetadata
- the map of metadata to use.- See Also:
-
setSetupData
Set the data for the setup payload.- Parameters:
setupData
- the data for connect frame.- See Also:
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Overrides:
afterPropertiesSet
in classAbstractRSocketConnector
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- Specified by:
afterSingletonsInstantiated
in interfaceSmartInitializingSingleton
- Overrides:
afterSingletonsInstantiated
in classAbstractRSocketConnector
-
doStart
protected void doStart()- Specified by:
doStart
in classAbstractRSocketConnector
-
destroy
public void destroy() -
connect
public void connect()Perform subscription into the RSocket server for incoming requests. -
getRequester
Return theRSocketRequester
this connector is built on.- Returns:
- the
RSocketRequester
this connector is built on. - Since:
- 5.4
-