Log connection info in StompBrokerRelayMessageHandler

See gh-29287
This commit is contained in:
rstoyanchev 2022-11-23 13:58:24 +00:00
parent e77c426eeb
commit a3c89092e1
3 changed files with 12 additions and 3 deletions

View File

@ -442,7 +442,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
}
if (logger.isInfoEnabled()) {
logger.info("Starting \"system\" session, " + toString());
logger.info("Starting \"system\" session, " + this);
}
StompHeaderAccessor accessor = StompHeaderAccessor.create(StompCommand.CONNECT);
@ -699,7 +699,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
@Override
public void afterConnected(TcpConnection<byte[]> connection) {
if (logger.isDebugEnabled()) {
logger.debug("TCP connection opened in session=" + getSessionId());
logger.debug("TCP connection " + connection + " opened in session=" + getSessionId());
}
this.tcpConnection = connection;
connection.onReadInactivity(() -> {
@ -978,7 +978,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
this.tcpConnection = null;
if (conn != null) {
if (logger.isDebugEnabled()) {
logger.debug("Closing TCP connection in session " + this.sessionId);
logger.debug("Closing TCP connection " + conn + " in session " + this.sessionId);
}
conn.close();
}

View File

@ -81,4 +81,8 @@ public class ReactorNetty2TcpConnection<P> implements TcpConnection<P> {
this.completionSink.tryEmitEmpty();
}
@Override
public String toString() {
return "ReactorNetty2TcpConnection[inbound=" + this.inbound + "]";
}
}

View File

@ -80,4 +80,9 @@ public class ReactorNettyTcpConnection<P> implements TcpConnection<P> {
this.completionSink.tryEmitEmpty();
}
@Override
public String toString() {
return "ReactorNettyTcpConnection[inbound=" + this.inbound + "]";
}
}