Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug logging for WebSocket lifecycle in WebSocketStompClient #23793

Conversation

alexandrumm
Copy link

@pivotal-issuemaster This is an Obvious Fix

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 14, 2019
@rstoyanchev rstoyanchev self-assigned this Oct 15, 2019
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 15, 2019
@rstoyanchev rstoyanchev added this to the 5.1.11 milestone Oct 15, 2019
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Oct 15, 2019

I think this should be done by decorating the WebSocketHandler, i.e. WebSocketTcpConnectionHandlerAdapter, with LoggingWebSocketHandlerDecorator consistent with what we do in other places like WebSocketConnectionManager and WebSocketHttpRequestHandler.

@alexandrumm
Copy link
Author

Hello, @rstoyanchev.
First of all thanks for responding and taking care of this PR.
I have a question with regards to your suggestion, WebSocketTcpConnectionHandlerAdapter it is also implementing the interface ListenableFutureCallback and the LoggingWebSocketHandlerDecorator does not expect or suppose, I think, to cover this type of handler, so could you please give me a hint here on how to proceed?

Thanks in advance!

@rstoyanchev
Copy link
Contributor

This should be fine:

WebSocketTcpConnectionHandlerAdapter adapter =  new WebSocketTcpConnectionHandlerAdapter(session);
getWebSocketClient()
        .doHandshake(new LoggingWebSocketHandlerDecorator(adapter), handshakeHeaders, url)
        .addCallback(adapter);

@alexandrumm
Copy link
Author

alexandrumm commented Oct 16, 2019

Right, I missed the obvious solution there. Thanks a lot! 😄

@rstoyanchev rstoyanchev changed the title Added debug log of CloseStatus Debug logging for WebSocket lifecycle in WebSocketStompClient Oct 30, 2019
rstoyanchev added a commit that referenced this pull request Oct 30, 2019
rstoyanchev added a commit that referenced this pull request Oct 30, 2019
pull bot pushed a commit to scope-demo/spring-framework that referenced this pull request Oct 30, 2019
pull bot pushed a commit to scope-demo/spring-framework that referenced this pull request Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants