wso2 / wso2/api-platform

WebBrokerAPI: Fix stale WebBrokerApi route handlers after xDS remove/update

Open
#1,964 0 comments 0 reactions 1 assignee View on GitHub

@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

  1. Start the event gateway in xDS (control plane) mode.
  2. Add a WebBrokerApi binding via xDS — a handler is registered on r.wsMux.
  3. Delete or update the binding via xDS — RemoveWebBrokerApiBinding is called.
  4. The route remains active on r.wsMux because the path was never stored in
    bindingPaths and r.websubMux.Remove is called instead of a removal on r.wsMux.

Required changes

  • Record each registered WebBrokerApi path in bindingPaths[wbb.Name] inside
    AddWebBrokerApiBinding.
  • Switch r.wsMux from *http.ServeMux to a removable mux implementation
    (e.g., the existing DynamicMux type, same as r.websubMux) so routes can be
    deregistered.
  • Update RemoveWebBrokerApiBinding to look up paths in bindingPaths, call the
    removal API on r.wsMux, and delete the bindingPaths entry.

Related

Requested by

@senthuran16

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.