Skip to content

WebSocketMessageBrokerStats does not work unless SockJS is enabled with WebSocket XML namespace [SPR-14190] #18763

@spring-projects-issues

Description

@spring-projects-issues

Joe Sweden opened SPR-14190 and commented

In the Spring reference documentation for Websockets it states:

When using @EnableWebSocketMessageBroker or websocket:message-broker key infrastructure components automatically gather stats and counters that provide important insight into the internal state of the application. The configuration also declares a bean of type WebSocketMessageBrokerStats that gathers all available information in one place and by default logs it at INFO level once every 30 minutes.

we are using a websocket:message-broker but the INFO log is never performed. This was unexpected after reading the above documentation, but was fixed by adding sockJS. It probably should be clarified that this logging is actually ONLY performed if you have configured sockJS. The SockJS Task Scheduler is used to to the logging, and if the websocket:sockjs/ tag is not in the websocket context file, this Scheduler is null. I don't know if this is unintended in the code or not, but at least the documentation should be clearer on this point.


Affects: 4.2.5, 4.3 RC1

Reference URL: http://docs.spring.io/spring/docs/current/spring-framework-reference/html/websocket.html#websocket-stomp-stats

Referenced from: commits 9fa0614, 8f0f5fa

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions