Class NettyRSocketServerFactory

java.lang.Object
org.springframework.boot.rsocket.netty.NettyRSocketServerFactory
All Implemented Interfaces:
ConfigurableRSocketServerFactory, RSocketServerFactory

public class NettyRSocketServerFactory extends Object implements RSocketServerFactory, ConfigurableRSocketServerFactory
RSocketServerFactory that can be used to create RSocketServers backed by Netty.
Since:
2.2.0
  • Constructor Details

    • NettyRSocketServerFactory

      public NettyRSocketServerFactory()
  • Method Details

    • setPort

      public void setPort(int port)
      Description copied from interface: ConfigurableRSocketServerFactory
      Set the port that the server should listen on. If not specified port '9898' will be used.
      Specified by:
      setPort in interface ConfigurableRSocketServerFactory
      Parameters:
      port - the port to set
    • setFragmentSize

      public void setFragmentSize(org.springframework.util.unit.DataSize fragmentSize)
      Description copied from interface: ConfigurableRSocketServerFactory
      Specify the maximum transmission unit. Frames larger than the specified fragmentSize are fragmented.
      Specified by:
      setFragmentSize in interface ConfigurableRSocketServerFactory
      Parameters:
      fragmentSize - the fragment size
    • setAddress

      public void setAddress(InetAddress address)
      Description copied from interface: ConfigurableRSocketServerFactory
      Set the specific network address that the server should bind to.
      Specified by:
      setAddress in interface ConfigurableRSocketServerFactory
      Parameters:
      address - the address to set (defaults to null)
    • setTransport

      public void setTransport(RSocketServer.Transport transport)
      Description copied from interface: ConfigurableRSocketServerFactory
      Set the transport that the RSocket server should use.
      Specified by:
      setTransport in interface ConfigurableRSocketServerFactory
      Parameters:
      transport - the transport protocol to use
    • setSsl

      public void setSsl(Ssl ssl)
      Description copied from interface: ConfigurableRSocketServerFactory
      Sets the SSL configuration that will be applied to the server's default connector.
      Specified by:
      setSsl in interface ConfigurableRSocketServerFactory
      Parameters:
      ssl - the SSL configuration
    • setSslStoreProvider

      public void setSslStoreProvider(SslStoreProvider sslStoreProvider)
      Description copied from interface: ConfigurableRSocketServerFactory
      Sets a provider that will be used to obtain SSL stores.
      Specified by:
      setSslStoreProvider in interface ConfigurableRSocketServerFactory
      Parameters:
      sslStoreProvider - the SSL store provider
    • setResourceFactory

      public void setResourceFactory(org.springframework.http.client.reactive.ReactorResourceFactory resourceFactory)
      Set the ReactorResourceFactory to get the shared resources from.
      Parameters:
      resourceFactory - the server resources
    • setRSocketServerCustomizers

      public void setRSocketServerCustomizers(Collection<? extends RSocketServerCustomizer> rSocketServerCustomizers)
      Set RSocketServerCustomizers that should be called to configure the RSocketServer while building the server. Calling this method will replace any existing customizers.
      Parameters:
      rSocketServerCustomizers - customizers to apply before the server starts
      Since:
      2.2.7
    • addRSocketServerCustomizers

      public void addRSocketServerCustomizers(RSocketServerCustomizer... rSocketServerCustomizers)
      Add RSocketServerCustomizers that should be called to configure the RSocketServer.
      Parameters:
      rSocketServerCustomizers - customizers to apply before the server starts
      Since:
      2.2.7
    • setLifecycleTimeout

      public void setLifecycleTimeout(Duration lifecycleTimeout)
      Set the maximum amount of time that should be waited when starting or stopping the server.
      Parameters:
      lifecycleTimeout - the lifecycle timeout
    • create

      public NettyRSocketServer create(io.rsocket.SocketAcceptor socketAcceptor)
      Description copied from interface: RSocketServerFactory
      Gets a new fully configured but paused RSocketServer instance. Clients should not be able to connect to the returned server until RSocketServer.start() is called (which happens when the ApplicationContext has been fully refreshed).
      Specified by:
      create in interface RSocketServerFactory
      Parameters:
      socketAcceptor - the socket acceptor
      Returns:
      a fully configured and started RSocketServer
      See Also: