Skip to content

Commit 473ce95

Browse files
rstoyanchevpull[bot]
authored andcommitted
Logging decorator for WebSocketStompClient handler
Closes spring-projectsgh-23793
1 parent 66912e9 commit 473ce95

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -57,6 +57,7 @@
5757
import org.springframework.web.socket.WebSocketMessage;
5858
import org.springframework.web.socket.WebSocketSession;
5959
import org.springframework.web.socket.client.WebSocketClient;
60+
import org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator;
6061
import org.springframework.web.socket.sockjs.transport.SockJsSession;
6162
import org.springframework.web.util.UriComponentsBuilder;
6263

@@ -265,7 +266,9 @@ public ListenableFuture<StompSession> connect(URI url, @Nullable WebSocketHttpHe
265266
Assert.notNull(url, "'url' must not be null");
266267
ConnectionHandlingStompSession session = createSession(connectHeaders, sessionHandler);
267268
WebSocketTcpConnectionHandlerAdapter adapter = new WebSocketTcpConnectionHandlerAdapter(session);
268-
getWebSocketClient().doHandshake(adapter, handshakeHeaders, url).addCallback(adapter);
269+
getWebSocketClient()
270+
.doHandshake(new LoggingWebSocketHandlerDecorator(adapter), handshakeHeaders, url)
271+
.addCallback(adapter);
269272
return session.getSessionFuture();
270273
}
271274

0 commit comments

Comments
 (0)