Currently, we don't provide mechanism to close by user-id or get connection-id by user-id. But we think it makes sense to provide a RestAPI to close by user-id. We will put it on our roadmap.
how to close PubSub connections on demand
Since PubSub has a connection limit count, I want to manage the connections and close the ones that is not needed any more. This is necessary as we can't depend on the client side to close the connection voluntarily.
I am ware that through the WebHook, I can collect all the connection IDs on the event [azure.webpubsub.sys.connected], and then I can choose to close some connections as needed. However, I will have to maintain those connection IDs.
Is there any way to close all the connections for a given UserId? The SDK only provides the capability to close a connection by connection ID.
Alternatively, is there a way to get the list of active connections for a given User ID? I really don't want to maintain those connection IDs. It feels like it should be the responsibility of the PubSub service.
Thanks!