-
What is the expected behavior of a Broker when a client sends an UNSUBSCRIBE with the ID of an existing subscription, but for which it never subscribed? For example Client 1
Client 2
My guess is that the Broker should respond with an ERROR with URI= This behavior is also what I would expect from a client unsubscribing twice to a subscription it actually owned:
This way, the broker always applies the same logic without having to remember that a client previously had a subscription to the topic it wants to unsubscribe from. The same question applies to unregistering an non-owned registration. Please let me know if my reasoning is correct. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
I think an UNSUBSCRIBE or UNREGISTER should never have any effect on any client other than itself. DEALER should be implemented such that client's can't know about each other's subscriptions/registrations. Registration/subscription ID's of different clients should even be able to overlap. Also my first hunch about sending an UNSUBSCRIBE to a subscription it doesn't currently own should result in a protocol violation? There can't be races here because of network since a client initiates subscribe/unsubscribe (or registrations) itself. Unless the meta api was used to forcefully unsubscribe someone. So maybe only in that case, no protocol violation since now there can be races? |
Beta Was this translation helpful? Give feedback.
-
My thoughts on topic:
|
Beta Was this translation helpful? Give feedback.
-
@Jopie64 you forgot about wildcards and prefixes. For simple exact topics, your scheme may be ok :) As an event must be delivered to all clients connected to the router - it is logical that subscriptions are in the router scope, but not in the session. The unsubscribing and unregistering on the other hand always happens in the context of exact session, and router knows what subscriptions that session has. |
Beta Was this translation helpful? Give feedback.
The way I understand it, there is only one subscription ID per topic+match_policy combo, as confirmed by the
wamp.subscription.lookup
meta procedure.Several subscribers can associated with the same subscription ID, as confirmed by the
wamp.subscription.list_subscribers
meta procedure which takes asubscription|id
argument and returns a list of subscriber session IDs.So subscriber IDs are not unique to each subscriber as far as the meta API is concerned.