Merge pull request #23793 from alexandrumm/ws-stomp-client-add-log
This commit is contained in:
		
						commit
						0e08e19070
					
				|  | @ -1,5 +1,5 @@ | |||
| /* | ||||
|  * Copyright 2002-2018 the original author or authors. | ||||
|  * Copyright 2002-2019 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. | ||||
|  | @ -57,6 +57,7 @@ import org.springframework.web.socket.WebSocketHttpHeaders; | |||
| import org.springframework.web.socket.WebSocketMessage; | ||||
| import org.springframework.web.socket.WebSocketSession; | ||||
| import org.springframework.web.socket.client.WebSocketClient; | ||||
| import org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator; | ||||
| import org.springframework.web.socket.sockjs.transport.SockJsSession; | ||||
| import org.springframework.web.util.UriComponentsBuilder; | ||||
| 
 | ||||
|  | @ -265,7 +266,9 @@ public class WebSocketStompClient extends StompClientSupport implements SmartLif | |||
| 		Assert.notNull(url, "'url' must not be null"); | ||||
| 		ConnectionHandlingStompSession session = createSession(connectHeaders, sessionHandler); | ||||
| 		WebSocketTcpConnectionHandlerAdapter adapter = new WebSocketTcpConnectionHandlerAdapter(session); | ||||
| 		getWebSocketClient().doHandshake(adapter, handshakeHeaders, url).addCallback(adapter); | ||||
| 		getWebSocketClient() | ||||
| 				.doHandshake(new LoggingWebSocketHandlerDecorator(adapter), handshakeHeaders, url) | ||||
| 				.addCallback(adapter); | ||||
| 		return session.getSessionFuture(); | ||||
| 	} | ||||
| 
 | ||||
|  |  | |||
|  | @ -46,6 +46,7 @@ import org.springframework.web.socket.TextMessage; | |||
| import org.springframework.web.socket.WebSocketHandler; | ||||
| import org.springframework.web.socket.WebSocketSession; | ||||
| import org.springframework.web.socket.client.WebSocketClient; | ||||
| import org.springframework.web.socket.handler.WebSocketHandlerDecorator; | ||||
| 
 | ||||
| import static org.assertj.core.api.Assertions.assertThat; | ||||
| import static org.assertj.core.api.Assertions.assertThatIllegalStateException; | ||||
|  | @ -319,9 +320,12 @@ public class WebSocketStompClientTests { | |||
| 
 | ||||
| 	@SuppressWarnings("unchecked") | ||||
| 	private TcpConnection<byte[]> getTcpConnection() throws Exception { | ||||
| 		WebSocketHandler webSocketHandler = connect(); | ||||
| 		webSocketHandler.afterConnectionEstablished(this.webSocketSession); | ||||
| 		return (TcpConnection<byte[]>) webSocketHandler; | ||||
| 		WebSocketHandler handler = connect(); | ||||
| 		handler.afterConnectionEstablished(this.webSocketSession); | ||||
| 		if (handler instanceof WebSocketHandlerDecorator) { | ||||
| 			handler = ((WebSocketHandlerDecorator) handler).getLastHandler(); | ||||
| 		} | ||||
| 		return (TcpConnection<byte[]>) handler; | ||||
| 	} | ||||
| 
 | ||||
| 	private void testInactivityTaskScheduling(Runnable runnable, long delay, long sleepTime) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue