Class StompBrokerRelayRegistration
java.lang.Object
org.springframework.messaging.simp.config.AbstractBrokerRegistration
org.springframework.messaging.simp.config.StompBrokerRelayRegistration
Registration class for configuring a 
StompBrokerRelayMessageHandler.- Since:
- 4.0
- Author:
- Rossen Stoyanchev
- 
Constructor SummaryConstructorsConstructorDescriptionStompBrokerRelayRegistration(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel, String[] destinationPrefixes) Create a newStompBrokerRelayRegistration.
- 
Method SummaryModifier and TypeMethodDescriptionprotected StompBrokerRelayMessageHandlergetMessageHandler(SubscribableChannel brokerChannel) setAutoStartup(boolean autoStartup) Configure whether theStompBrokerRelayMessageHandlershould start automatically when the Spring ApplicationContext is refreshed.setClientLogin(String login) Set the login to use when creating connections to the STOMP broker on behalf of connected clients.setClientPasscode(String passcode) Set the passcode to use when creating connections to the STOMP broker on behalf of connected clients.setRelayHost(String relayHost) Set the STOMP message broker host.setRelayPort(int relayPort) Set the STOMP message broker port.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.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.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.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.setTaskScheduler(@Nullable TaskScheduler taskScheduler) Some STOMP clients (for example, stomp-js) always send heartbeats at a fixed rate but others (Spring STOMP client) do so only when no other messages are sent.setTcpClient(TcpOperations<byte[]> tcpClient) Configure a TCP client for managing TCP connections to the STOMP broker.setUserDestinationBroadcast(String destination) Set a destination to broadcast messages to user destinations that remain unresolved because the user appears not to be connected.setUserRegistryBroadcast(String destination) Set a destination to broadcast the content of the local user registry to and to listen for such broadcasts from other servers.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.AbstractBrokerRegistrationgetClientInboundChannel, getClientOutboundChannel, getDestinationPrefixes
- 
Constructor Details- 
StompBrokerRelayRegistrationpublic StompBrokerRelayRegistration(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel, String[] destinationPrefixes) Create a newStompBrokerRelayRegistration.- Parameters:
- clientInboundChannel- the inbound channel
- clientOutboundChannel- the outbound channel
- destinationPrefixes- the destination prefixes
 
 
- 
- 
Method Details- 
setRelayHostSet the STOMP message broker host.
- 
setRelayPortSet the STOMP message broker port.
- 
setClientLoginSet the login to use when creating connections to the STOMP broker on behalf of connected clients.By default this is set to "guest". 
- 
setClientPasscodeSet the passcode to use when creating connections to the STOMP broker on behalf of connected clients.By default this is set to "guest". 
- 
setSystemLoginSet 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 (for example, REST/HTTP request handling method).By default this is set to "guest". 
- 
setSystemPasscodeSet 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 (for example, REST/HTTP request handling method).By default this is set to "guest". 
- 
setSystemHeartbeatSendIntervalpublic 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. 
- 
setSystemHeartbeatReceiveIntervalpublic 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. 
- 
setVirtualHostSet 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. 
- 
setTcpClientConfigure a TCP client for managing TCP connections to the STOMP broker.By default ReactorNettyTcpClientis used.Note: when this property is used, any hostorportspecified are effectively ignored.- Since:
- 4.3.15
 
- 
setTaskSchedulerSome STOMP clients (for example, stomp-js) always send heartbeats at a fixed rate but others (Spring STOMP client) do so only when no other messages are sent. However messages with a non-brokerdestination prefixaren't forwarded and as a result the broker may deem the connection inactive.When this TaskScheduleris set, it is used to reset a count of the number of messages sent from client to broker since the beginning of the current heartbeat period. This is then used to decide whether to send a heartbeat to the broker when ignoring a message with a non-broker destination prefix.- Since:
- 5.3
 
- 
setAutoStartupConfigure whether theStompBrokerRelayMessageHandlershould start automatically when the Spring ApplicationContext is refreshed.The default setting is true.
- 
setUserDestinationBroadcastSet a destination to broadcast messages to user destinations that remain unresolved because the user appears not to be connected. In a multi-application server scenario this gives other application servers a chance to try.By default this is not set. - Parameters:
- destination- the destination to broadcast unresolved messages to, for example, "/topic/unresolved-user-destination"
 
- 
getUserDestinationBroadcast
- 
setUserRegistryBroadcastSet a destination to broadcast the content of the local user registry to and to listen for such broadcasts from other servers. In a multi-application server scenarios this allows each server's user registry to be aware of users connected to other servers.By default this is not set. - Parameters:
- destination- the destination for broadcasting user registry details, for example, "/topic/simp-user-registry".
 
- 
getUserRegistryBroadcast
- 
getMessageHandler- Specified by:
- getMessageHandlerin class- AbstractBrokerRegistration
 
 
-