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
public class ClientRSocketConnector extends AbstractRSocketConnector
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 -
Constructor Summary
Constructors Constructor Description ClientRSocketConnector(io.rsocket.transport.ClientTransport clientTransport)Instantiate a connector based on the providedClientTransport.ClientRSocketConnector(String host, int port)Instantiate a connector based on theTcpClientTransport.ClientRSocketConnector(URI uri)Instantiate a connector based on theWebsocketClientTransport. -
Method Summary
Modifier and Type Method Description voidafterPropertiesSet()voidafterSingletonsInstantiated()voidconnect()Perform subscription into the RSocket server for incoming requests.voiddestroy()protected voiddoStart()RSocketRequestergetRequester()Return theRSocketRequesterthis connector is built on.reactor.core.publisher.Mono<RSocketRequester>getRSocketRequester()Deprecated.since 5.4 in favor ofgetRequester()voidsetConnectorConfigurer(RSocketConnectorConfigurer connectorConfigurer)Callback to configure theClientRSocketFactorydirectly.voidsetSetupData(Object setupData)Set the data for the setup payload.voidsetSetupMetadata(Map<Object,MimeType> setupMetadata)Add metadata to the setup payload.voidsetSetupRoute(String setupRoute)Set the route for the setup payload.voidsetSetupRouteVariables(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
-
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(ClientTransport)
-
ClientRSocketConnector
Instantiate a connector based on theWebsocketClientTransport.- Parameters:
uri- the WebSocket URI to connect.- See Also:
ClientRSocketConnector(ClientTransport)
-
ClientRSocketConnector
public ClientRSocketConnector(io.rsocket.transport.ClientTransport clientTransport)Instantiate a connector based on the providedClientTransport.- Parameters:
clientTransport- theClientTransportto use.- See Also:
RSocketRequester.Builder.transport(ClientTransport)
-
-
Method Details
-
setConnectorConfigurer
Callback to configure theClientRSocketFactorydirectly. Note: this class adds extraRSocketConnectorConfigurerto the targetRSocketRequesterto populate a reference to an internalRSocketMessageHandler.responder(). This overrides possible externalRSocketConnector.acceptor(io.rsocket.SocketAcceptor)- Parameters:
connectorConfigurer- theRSocketConnectorConfigurerto configure theRSocketConnector.- Since:
- 5.2.6
- See Also:
RSocketRequester.Builder.rsocketConnector(RSocketConnectorConfigurer)
-
setSetupRoute
Set the route for the setup payload.- Parameters:
setupRoute- the route to connect to.- See Also:
RSocketRequester.Builder.setupRoute(String, Object...)
-
setSetupRouteVariables
Set the variables for route template to expand with.- Parameters:
setupRouteVars- the route to connect to.- See Also:
RSocketRequester.Builder.setupRoute(String, Object...)
-
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:
RSocketRequester.Builder.setupMetadata(Object, MimeType)
-
setSetupData
Set the data for the setup payload.- Parameters:
setupData- the data for connect frame.- See Also:
RSocketRequester.Builder.setupData(Object)
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceInitializingBean- Overrides:
afterPropertiesSetin classAbstractRSocketConnector
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- Specified by:
afterSingletonsInstantiatedin interfaceSmartInitializingSingleton- Overrides:
afterSingletonsInstantiatedin classAbstractRSocketConnector
-
doStart
protected void doStart()- Specified by:
doStartin classAbstractRSocketConnector
-
destroy
public void destroy() -
connect
public void connect()Perform subscription into the RSocket server for incoming requests. -
getRSocketRequester
Deprecated.since 5.4 in favor ofgetRequester()Return theMonofor theRSocketRequester.- Returns:
- the
Monofor theRSocketRequester.
-
getRequester
Return theRSocketRequesterthis connector is built on.- Returns:
- the
RSocketRequesterthis connector is built on. - Since:
- 5.4
-