Skip to content

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`**
@artembilan artembilan requested a review from garyrussell April 19, 2023 16:31
Co-authored-by: Gary Russell <[email protected]>
@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 <[email protected]>

---------

Co-authored-by: Gary Russell <[email protected]>
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 <[email protected]>

---------

Co-authored-by: Gary Russell <[email protected]>
@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