org.springframework.messaging.simp.config

## Class StompBrokerRelayRegistration

- java.lang.Object
- - org.springframework.messaging.simp.config.AbstractBrokerRegistration
  - - org.springframework.messaging.simp.config.StompBrokerRelayRegistration

-     public class StompBrokerRelayRegistration
      extends AbstractBrokerRegistration

  Registration class for configuring a `StompBrokerRelayMessageHandler`.
  Since:
    4.0
  Author:
    Rossen Stoyanchev

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StompBrokerRelayRegistration(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel, String[] destinationPrefixes)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected StompBrokerRelayMessageHandler` | `getMessageHandler(SubscribableChannel brokerChannel)`
    `StompBrokerRelayRegistration` | `setAutoStartup(boolean autoStartup)` Configure whether the `StompBrokerRelayMessageHandler` should start automatically when the Spring ApplicationContext is refreshed.
    `StompBrokerRelayRegistration` | `setClientLogin(String login)` Set the login to use when creating connections to the STOMP broker on behalf of connected clients.
    `StompBrokerRelayRegistration` | `setClientPasscode(String passcode)` Set the passcode to use when creating connections to the STOMP broker on behalf of connected clients.
    `StompBrokerRelayRegistration` | `setRelayHost(String relayHost)` Set the STOMP message broker host.
    `StompBrokerRelayRegistration` | `setRelayPort(int relayPort)` Set the STOMP message broker port.
    `StompBrokerRelayRegistration` | `setSystemHeartbeatReceiveInterval(long heartbeatReceiveInterval)` Set the maximum interval, in milliseconds, at which the "system" relay session expects, in the absence of any other data, to receive a heartbeat from the STOMP broker.
    `StompBrokerRelayRegistration` | `setSystemHeartbeatSendInterval(long systemHeartbeatSendInterval)` Set the interval, in milliseconds, at which the "system" relay session will, in the absence of any other data being sent, send a heartbeat to the STOMP broker.
    `StompBrokerRelayRegistration` | `setSystemLogin(String login)` Set the login for the shared "system" connection used to send messages to the STOMP broker from within the application, i.e.
    `StompBrokerRelayRegistration` | `setSystemPasscode(String passcode)` Set the passcode for the shared "system" connection used to send messages to the STOMP broker from within the application, i.e.
    `StompBrokerRelayRegistration` | `setVirtualHost(String virtualHost)` Set the value of the "host" header to use in STOMP CONNECT frames.

    - ### Methods inherited from class org.springframework.messaging.simp.config.AbstractBrokerRegistration

      `getClientInboundChannel, getClientOutboundChannel, getDestinationPrefixes`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StompBrokerRelayRegistration

          public StompBrokerRelayRegistration(SubscribableChannel clientInboundChannel,
                                              MessageChannel clientOutboundChannel,
                                              String[] destinationPrefixes)

  - ### Method Detail

    - #### setRelayHost

          public StompBrokerRelayRegistration setRelayHost(String relayHost)

      Set the STOMP message broker host.

    - #### setRelayPort

          public StompBrokerRelayRegistration setRelayPort(int relayPort)

      Set the STOMP message broker port.

    - #### setClientLogin

          public StompBrokerRelayRegistration setClientLogin(String login)

      Set the login to use when creating connections to the STOMP broker on behalf of connected clients.

      By default this is set to "guest".

    - #### setClientPasscode

          public StompBrokerRelayRegistration setClientPasscode(String passcode)

      Set the passcode to use when creating connections to the STOMP broker on behalf of connected clients.

      By default this is set to "guest".

    - #### setSystemLogin

          public StompBrokerRelayRegistration setSystemLogin(String login)

      Set the login for the shared "system" connection used to send messages to the STOMP broker from within the application, i.e. messages not associated with a specific client session (e.g. REST/HTTP request handling method).

      By default this is set to "guest".

    - #### setSystemPasscode

          public StompBrokerRelayRegistration setSystemPasscode(String passcode)

      Set the passcode for the shared "system" connection used to send messages to the STOMP broker from within the application, i.e. messages not associated with a specific client session (e.g. REST/HTTP request handling method).

      By default this is set to "guest".

    - #### setSystemHeartbeatSendInterval

          public StompBrokerRelayRegistration setSystemHeartbeatSendInterval(long systemHeartbeatSendInterval)

      Set the interval, in milliseconds, at which the "system" relay session will, in the absence of any other data being sent, send a heartbeat to the STOMP broker. A value of zero will prevent heartbeats from being sent to the broker.

      The default value is 10000.

    - #### setSystemHeartbeatReceiveInterval

          public StompBrokerRelayRegistration setSystemHeartbeatReceiveInterval(long heartbeatReceiveInterval)

      Set the maximum interval, in milliseconds, at which the "system" relay session expects, in the absence of any other data, to receive a heartbeat from the STOMP broker. A value of zero will configure the relay session to expect not to receive heartbeats from the broker.

      The default value is 10000.

    - #### setVirtualHost

          public StompBrokerRelayRegistration setVirtualHost(String virtualHost)

      Set the value of the "host" header to use in STOMP CONNECT frames. When this property is configured, a "host" header will be added to every STOMP frame sent to the STOMP broker. This may be useful for example in a cloud environment where the actual host to which the TCP connection is established is different from the host providing the cloud-based STOMP service.

      By default this property is not set.

    - #### setAutoStartup

          public StompBrokerRelayRegistration setAutoStartup(boolean autoStartup)

      Configure whether the `StompBrokerRelayMessageHandler` should start automatically when the Spring ApplicationContext is refreshed.

      The default setting is `true`.

    - #### getMessageHandler

          protected StompBrokerRelayMessageHandler getMessageHandler(SubscribableChannel brokerChannel)

      Specified by:
        `getMessageHandler` in class `AbstractBrokerRegistration`