Browse Source

Add messages for number of active sessions/connections

Issue: SPR-11531
pull/448/merge
Rossen Stoyanchev 12 years ago
parent
commit
cff23b84ae
  1. 3
      spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandler.java
  2. 6
      spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandler.java

3
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandler.java

@ -397,7 +397,8 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
} }
if (SimpMessageType.CONNECT.equals(messageType)) { if (SimpMessageType.CONNECT.equals(messageType)) {
logger.debug("Processing CONNECT in session=" + sessionId); logger.debug("Processing CONNECT in session=" + sessionId +
", number of connections=" + this.connectionHandlers.size());
headers.setLogin(this.clientLogin); headers.setLogin(this.clientLogin);
headers.setPasscode(this.clientPasscode); headers.setPasscode(this.clientPasscode);
if (getVirtualHost() != null) { if (getVirtualHost() != null) {

6
spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandler.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -199,6 +199,10 @@ public class SubProtocolWebSocketHandler
@Override @Override
public void afterConnectionEstablished(WebSocketSession session) throws Exception { public void afterConnectionEstablished(WebSocketSession session) throws Exception {
this.sessions.put(session.getId(), session); this.sessions.put(session.getId(), session);
if (logger.isDebugEnabled()) {
logger.debug("Started WebSocket session=" + session.getId() +
", number of sessions=" + this.sessions.size());
}
findProtocolHandler(session).afterSessionStarted(session, this.clientInboundChannel); findProtocolHandler(session).afterSessionStarted(session, this.clientInboundChannel);
} }

Loading…
Cancel
Save