WebBrokerAPI: Fix stale WebBrokerApi route handlers after xDS remove/update
Open
@senthuran16 is already working on this.
Since May 14, 2026.
Area/EventGateway
- Dominant language
- Go
- Stars
- 71
- Forks
- 111
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 110
Description
Summary
AddWebBrokerApiBinding in event-gateway/gateway-runtime/internal/runtime/runtime.go
registers receivers on r.wsMux but never records the route path in bindingPaths.
As a result, RemoveWebBrokerApiBinding cannot remove the handler from the mux and
leaves stale WebSocket routes active after the binding is removed via xDS.
Steps to reproduce
- Start the event gateway in xDS (control plane) mode.
- Add a
WebBrokerApibinding via xDS — a handler is registered onr.wsMux. - Delete or update the binding via xDS —
RemoveWebBrokerApiBindingis called. - The route remains active on
r.wsMuxbecause the path was never stored in
bindingPathsandr.websubMux.Removeis called instead of a removal onr.wsMux.
Required changes
- Record each registered WebBrokerApi path in
bindingPaths[wbb.Name]inside
AddWebBrokerApiBinding. - Switch
r.wsMuxfrom*http.ServeMuxto a removable mux implementation
(e.g., the existingDynamicMuxtype, same asr.websubMux) so routes can be
deregistered. - Update
RemoveWebBrokerApiBindingto look up paths inbindingPaths, call the
removal API onr.wsMux, and delete thebindingPathsentry.
Related
- PR: https://github.com/wso2/api-platform/pull/1954
- Review comment: https://github.com/wso2/api-platform/pull/1954#discussion_r3239562652
- Related work: https://github.com/wso2/api-platform/pull/1944
Requested by
@senthuran16
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.