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

Add ApplicationEvents for WebSocket connection and disconnection [SPR-11578] #16202

Closed
spring-projects-issues opened this issue Mar 18, 2014 · 4 comments
Assignees
Labels
in: web type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Mar 18, 2014

Sergi Almar opened SPR-11578 and commented

Even if detecting WebSocket connections and disconnections is currently doable with ChannelInterceptor / HandlerDecorator, these require some extra logic and configuration. It would be useful to have a more event driven and decoupled solution with ApplicationEvent s like WebSocketConnectEvent and WebSocketDisconnectEvent


Affects: 4.0.2

Referenced from: commits 13da705, a247d5f

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Mar 22, 2014

Rossen Stoyanchev commented

Sergi Almar, is it WebSocket session events you're looking for in which case the connect could have WebSocket session id, principal, and maybe HTTP handshake URL and headers (from the WebSocketSession essentially). The disconnect it may have a close status, error message, or Throwable if available.

Or are you more likely looking for connect and disconnect events on the sub-protocol level? In which case we can provide MessageHeaders with the event that correspond to the SimpMessageType that flow through the clientInbound and clientOutbound channels. Something along the lines of a SessionConnectEvent, SessionConnectedEvent, and SessionDisconnectEvent.

I am more inclined to provide the latter since they can provide all of the above including what we would provide in WebSocket events. Plus it's more on the level at which the client sees things, i.e. connecting through STOMP, providing connect headers, and so on.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Mar 24, 2014

Sergi Almar commented

I'm also interested to see the later one, I think it makes more sense and as you say, aligned to what the client does.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Mar 24, 2014

Rossen Stoyanchev commented

Sergi Almar this is now available. If you are able give it a quick look. We are probably releasing some time tomorrow so minor adjustments can still be made.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Mar 25, 2014

Sergi Almar commented

As discussed in private conversation, exceptions in listeners prevented proper connection / disconnection, should be fixed now with this change.

@spring-projects-issues spring-projects-issues added type: enhancement in: web labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.0.3 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants