From cff23b84ae6bac45972c16a84e4dbaa382576acc Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Mon, 10 Mar 2014 16:58:02 -0400 Subject: [PATCH] Add messages for number of active sessions/connections Issue: SPR-11531 --- .../simp/stomp/StompBrokerRelayMessageHandler.java | 3 ++- .../web/socket/messaging/SubProtocolWebSocketHandler.java | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandler.java index 4ce89dde73..ea15217ec4 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandler.java +++ b/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)) { - 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.setPasscode(this.clientPasscode); if (getVirtualHost() != null) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandler.java b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandler.java index 3b1fad8271..fee754ced6 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandler.java +++ b/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"); * you may not use this file except in compliance with the License. @@ -199,6 +199,10 @@ public class SubProtocolWebSocketHandler @Override public void afterConnectionEstablished(WebSocketSession session) throws Exception { 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); }