Class WebSocketMessageBrokerStats
java.lang.Object
org.springframework.web.socket.config.WebSocketMessageBrokerStats
- All Implemented Interfaces:
- SmartInitializingSingleton
A central class for aggregating information about internal state and counters
 from key infrastructure components of the setup that comes with
 
@EnableWebSocketMessageBroker for Java config and
 <websocket:message-broker> for XML.
 By default aggregated information is logged every 30 minutes at INFO level.
 The frequency of logging can be changed via setLoggingPeriod(long).
 
This class is declared as a Spring bean by the above configuration with the
 name "webSocketMessageBrokerStats" and can be easily exported to JMX, for example, with
 the MBeanExporter.
- Since:
- 4.1
- Author:
- Rossen Stoyanchev, Sam Brannen, Brian Clozel
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidInvoked right at the end of the singleton pre-instantiation phase, with a guarantee that all regular singleton beans have been created already.Get stats about the executor processing incoming messages from WebSocket clients.Get stats about the executor processing outgoing messages to WebSocket clients.longReturn the configured logging period frequency in milliseconds.Get stats about the SockJS task scheduler.Get stats about STOMP broker relay (when using a full-featured STOMP broker).Deprecated, for removal: This API element is subject to removal in a future version.Get stats about STOMP-related WebSocket message processing.Deprecated, for removal: This API element is subject to removal in a future version.as of 6.2 in favor ofgetStompSubProtocolStats().Get stats about WebSocket sessions.Deprecated, for removal: This API element is subject to removal in a future version.as of 6.2 in favor ofgetWebSocketSessionStats().voidsetInboundChannelExecutor(TaskExecutor inboundChannelExecutor) voidsetLoggingPeriod(long period) Set the frequency for logging information at INFO level in milliseconds.voidsetOutboundChannelExecutor(TaskExecutor outboundChannelExecutor) voidsetSockJsTaskScheduler(TaskScheduler sockJsTaskScheduler) voidsetStompBrokerRelay(StompBrokerRelayMessageHandler stompBrokerRelay) voidsetSubProtocolWebSocketHandler(SubProtocolWebSocketHandler webSocketHandler) toString()
- 
Constructor Details- 
WebSocketMessageBrokerStatspublic WebSocketMessageBrokerStats()
 
- 
- 
Method Details- 
setSubProtocolWebSocketHandler
- 
setStompBrokerRelay
- 
setInboundChannelExecutor
- 
setOutboundChannelExecutor
- 
setSockJsTaskScheduler
- 
setLoggingPeriodpublic void setLoggingPeriod(long period) Set the frequency for logging information at INFO level in milliseconds. If set 0 or less than 0, the logging task is cancelled.By default this property is set to 30 minutes (30 * 60 * 1000). 
- 
getLoggingPeriodpublic long getLoggingPeriod()Return the configured logging period frequency in milliseconds.
- 
afterSingletonsInstantiatedpublic void afterSingletonsInstantiated()Description copied from interface:SmartInitializingSingletonInvoked right at the end of the singleton pre-instantiation phase, with a guarantee that all regular singleton beans have been created already.ListableBeanFactory.getBeansOfType(java.lang.Class<T>)calls within this method won't trigger accidental side effects during bootstrap.NOTE: This callback won't be triggered for singleton beans lazily initialized on demand after BeanFactorybootstrap, and not for any other bean scope either. Carefully use it for beans with the intended bootstrap semantics only.- Specified by:
- afterSingletonsInstantiatedin interface- SmartInitializingSingleton
 
- 
getWebSocketSessionStatsInfoDeprecated, for removal: This API element is subject to removal in a future version.as of 6.2 in favor ofgetWebSocketSessionStats().Get stats about WebSocket sessions.
- 
getWebSocketSessionStatsGet stats about WebSocket sessions. Can returnnullif noWebSocket handleris configured.- Since:
- 6.2
 
- 
getStompSubProtocolStatsInfoDeprecated, for removal: This API element is subject to removal in a future version.as of 6.2 in favor ofgetStompSubProtocolStats().Get stats about STOMP-related WebSocket message processing.
- 
getStompSubProtocolStatsGet stats about STOMP-related WebSocket message processing. Can returnnullif noSubProtocolHandlerwas found.- Since:
- 6.2
 
- 
getStompBrokerRelayStatsInfoDeprecated, for removal: This API element is subject to removal in a future version.as of 6.2 in favor ofgetStompBrokerRelayStats().Get stats about STOMP broker relay (when using a full-featured STOMP broker).
- 
getStompBrokerRelayStatsGet stats about STOMP broker relay (when using a full-featured STOMP broker). Can returnnullif noSTOMP broker relayis configured.- Since:
- 6.2
 
- 
getClientInboundExecutorStatsInfoGet stats about the executor processing incoming messages from WebSocket clients.
- 
getClientOutboundExecutorStatsInfoGet stats about the executor processing outgoing messages to WebSocket clients.
- 
getSockJsTaskSchedulerStatsInfoGet stats about the SockJS task scheduler.
- 
toString
 
- 
getStompBrokerRelayStats().