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

GH-8600: Fix WebSocket removeRegistration #8601

Merged
merged 2 commits into from
Apr 19, 2023

Conversation

artembilan
Copy link
Member

Fixes #8600

When we register a dynamic WebSocket endpoint and use a WebSocketHandlerDecoratorFactory such an endpoint is not removed on an IntegrationFlow destruction. The actual WebSocketHandler is decorated, however we still use an initial one for condition.

  • Refactor IntegrationWebSocketContainer to expose a protected setter for the WebSocketHandler which is called from the ServerWebSocketContainer after decoration

Cherry-pick to 6.0.x & 5.5.x

Fixes spring-projects#8600

When we register a dynamic WebSocket endpoint and use a `WebSocketHandlerDecoratorFactory`
such an endpoint is not removed on an `IntegrationFlow` destruction.
The actual `WebSocketHandler` is decorated, however we still use an initial one
for condition.

* Refactor `IntegrationWebSocketContainer` to expose a `protected` setter for the
`WebSocketHandler` which is called from the `ServerWebSocketContainer` after decoration

**Cherry-pick to `6.0.x` & `5.5.x`**
Co-authored-by: Gary Russell <grussell@vmware.com>
@garyrussell garyrussell merged commit 1a579a6 into spring-projects:main Apr 19, 2023
garyrussell added a commit that referenced this pull request Apr 19, 2023
* GH-8600: Fix WebSocket `removeRegistration`

Fixes #8600

When we register a dynamic WebSocket endpoint and use a `WebSocketHandlerDecoratorFactory`
such an endpoint is not removed on an `IntegrationFlow` destruction.
The actual `WebSocketHandler` is decorated, however we still use an initial one
for condition.

* Refactor `IntegrationWebSocketContainer` to expose a `protected` setter for the
`WebSocketHandler` which is called from the `ServerWebSocketContainer` after decoration

**Cherry-pick to `6.0.x` & `5.5.x`**

* Fix language in Javadocs

Co-authored-by: Gary Russell <grussell@vmware.com>

---------

Co-authored-by: Gary Russell <grussell@vmware.com>
garyrussell added a commit that referenced this pull request Apr 19, 2023
* GH-8600: Fix WebSocket `removeRegistration`

Fixes #8600

When we register a dynamic WebSocket endpoint and use a `WebSocketHandlerDecoratorFactory`
such an endpoint is not removed on an `IntegrationFlow` destruction.
The actual `WebSocketHandler` is decorated, however we still use an initial one
for condition.

* Refactor `IntegrationWebSocketContainer` to expose a `protected` setter for the
`WebSocketHandler` which is called from the `ServerWebSocketContainer` after decoration

**Cherry-pick to `6.0.x` & `5.5.x`**

* Fix language in Javadocs

Co-authored-by: Gary Russell <grussell@vmware.com>

---------

Co-authored-by: Gary Russell <grussell@vmware.com>
@garyrussell
Copy link
Contributor

...and cherry-picked to 6.0.x as 9b42537 and to 5.5.x as d89badf after resolving conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't unregister websocket when using decorators on ServerWebSocketContainer
2 participants