public class WebSocketMessageBrokerStats extends Object implements SmartInitializingSingleton
@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, e.g. with
the MBeanExporter
.
Constructor and Description |
---|
WebSocketMessageBrokerStats() |
Modifier and Type | Method and Description |
---|---|
void |
afterSingletonsInstantiated()
Invoked right at the end of the singleton pre-instantiation phase,
with a guarantee that all regular singleton beans have been created
already.
|
String |
getClientInboundExecutorStatsInfo()
Get stats about the executor processing incoming messages from WebSocket clients.
|
String |
getClientOutboundExecutorStatsInfo()
Get stats about the executor processing outgoing messages to WebSocket clients.
|
long |
getLoggingPeriod()
Return the configured logging period frequency in milliseconds.
|
String |
getSockJsTaskSchedulerStatsInfo()
Get stats about the SockJS task scheduler.
|
String |
getStompBrokerRelayStatsInfo()
Get stats about STOMP broker relay (when using a full-featured STOMP broker).
|
String |
getStompSubProtocolStatsInfo()
Get stats about STOMP-related WebSocket message processing.
|
String |
getWebSocketSessionStatsInfo()
Get stats about WebSocket sessions.
|
void |
setInboundChannelExecutor(TaskExecutor inboundChannelExecutor) |
void |
setLoggingPeriod(long period)
Set the frequency for logging information at INFO level in milliseconds.
|
void |
setOutboundChannelExecutor(TaskExecutor outboundChannelExecutor) |
void |
setSockJsTaskScheduler(TaskScheduler sockJsTaskScheduler) |
void |
setStompBrokerRelay(StompBrokerRelayMessageHandler stompBrokerRelay) |
void |
setSubProtocolWebSocketHandler(SubProtocolWebSocketHandler webSocketHandler) |
String |
toString() |
public void setSubProtocolWebSocketHandler(SubProtocolWebSocketHandler webSocketHandler)
public void setStompBrokerRelay(StompBrokerRelayMessageHandler stompBrokerRelay)
public void setInboundChannelExecutor(TaskExecutor inboundChannelExecutor)
public void setOutboundChannelExecutor(TaskExecutor outboundChannelExecutor)
public void setSockJsTaskScheduler(TaskScheduler sockJsTaskScheduler)
public void setLoggingPeriod(long period)
By default this property is set to 30 minutes (30 * 60 * 1000).
public long getLoggingPeriod()
public void afterSingletonsInstantiated()
SmartInitializingSingleton
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 BeanFactory
bootstrap,
and not for any other bean scope either. Carefully use it for beans
with the intended bootstrap semantics only.
afterSingletonsInstantiated
in interface SmartInitializingSingleton
public String getWebSocketSessionStatsInfo()
public String getStompSubProtocolStatsInfo()
public String getStompBrokerRelayStatsInfo()
public String getClientInboundExecutorStatsInfo()
public String getClientOutboundExecutorStatsInfo()
public String getSockJsTaskSchedulerStatsInfo()