Class ClientRSocketConnector

java.lang.Object
org.springframework.integration.rsocket.AbstractRSocketConnector
org.springframework.integration.rsocket.ClientRSocketConnector
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.SmartInitializingSingleton, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class ClientRSocketConnector
extends AbstractRSocketConnector
A client AbstractRSocketConnector extension to the RSocket connection.
Since:
5.2
See Also:
RSocketConnector, RSocketRequester
  • Constructor Details

    • ClientRSocketConnector

      public ClientRSocketConnector​(java.lang.String host, int port)
      Instantiate a connector based on the TcpClientTransport.
      Parameters:
      host - the TCP host to connect.
      port - the TCP port to connect.
      See Also:
      ClientRSocketConnector(ClientTransport)
    • ClientRSocketConnector

      public ClientRSocketConnector​(java.net.URI uri)
      Instantiate a connector based on the WebsocketClientTransport.
      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 provided ClientTransport.
      Parameters:
      clientTransport - the ClientTransport to use.
      See Also:
      RSocketRequester.Builder.transport(ClientTransport)
  • Method Details

    • setConnectorConfigurer

      public void setConnectorConfigurer​(org.springframework.messaging.rsocket.RSocketConnectorConfigurer connectorConfigurer)
      Callback to configure the 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)
      Parameters:
      connectorConfigurer - the RSocketConnectorConfigurer to configure the RSocketConnector.
      Since:
      5.2.6
      See Also:
      RSocketRequester.Builder.rsocketConnector(RSocketConnectorConfigurer)
    • setSetupRoute

      public void setSetupRoute​(java.lang.String setupRoute)
      Set the route for the setup payload.
      Parameters:
      setupRoute - the route to connect to.
      See Also:
      RSocketRequester.Builder.setupRoute(String, Object...)
    • setSetupRouteVariables

      public void setSetupRouteVariables​(java.lang.Object... setupRouteVars)
      Set the variables for route template to expand with.
      Parameters:
      setupRouteVars - the route to connect to.
      See Also:
      RSocketRequester.Builder.setupRoute(String, Object...)
    • setSetupMetadata

      public void setSetupMetadata​(java.util.Map<java.lang.Object,​org.springframework.util.MimeType> setupMetadata)
      Add metadata to the setup payload. Composite metadata must be in use if this is called more than once or in addition to setSetupRoute(String).
      Parameters:
      setupMetadata - the map of metadata to use.
      See Also:
      RSocketRequester.Builder.setupMetadata(Object, MimeType)
    • setSetupData

      public void setSetupData​(java.lang.Object setupData)
      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:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Overrides:
      afterPropertiesSet in class AbstractRSocketConnector
    • afterSingletonsInstantiated

      public void afterSingletonsInstantiated()
      Specified by:
      afterSingletonsInstantiated in interface org.springframework.beans.factory.SmartInitializingSingleton
      Overrides:
      afterSingletonsInstantiated in class AbstractRSocketConnector
    • doStart

      protected void doStart()
      Specified by:
      doStart in class AbstractRSocketConnector
    • destroy

      public void destroy()
    • connect

      public void connect()
      Perform subscription into the RSocket server for incoming requests.
    • getRSocketRequester

      @Deprecated public reactor.core.publisher.Mono<org.springframework.messaging.rsocket.RSocketRequester> getRSocketRequester()
      Deprecated.
      since 5.4 in favor of getRequester()
      Return the Mono for the RSocketRequester.
      Returns:
      the Mono for the RSocketRequester.
    • getRequester

      public org.springframework.messaging.rsocket.RSocketRequester getRequester()
      Return the RSocketRequester this connector is built on.
      Returns:
      the RSocketRequester this connector is built on.
      Since:
      5.4