Managing subscriptions
A client can use the SubscriptionControl feature to subscribe other client sessions to topics that they have not requested subscription to themselves and also to unsubscribe clients from topics.
Subscribing and unsubscribing clients
Required permissions:
, permission for the topics being subscribed toA client can subscribe client sessions that it knows about to topics that those clients have not explicitly requested. It can also unsubscribe clients from topics.
A session identifier is required to specify the client session that is to be subscribed or unsubscribed. Use the ClientControl feature to get the identifiers for connected client sessions.
The SubscriptionControl feature uses topic selectors to specify topics for subscription and unsubscription. Many topics can be specified in a single operation.
The client being subscribed to topics must have
permission for the topics it is being subscribed to.Using session properties to select clients to subscribe and unsubscribe
Required permissions:
, , permission for the topics being subscribed toWhen managing client subscriptions, a client can specify a filter for which client sessions it subscribes to topics or unsubscribes from topics. The filter is a query expression on the values of session properties.
The managing client defines a filter and sends a subscription request with this filter to Diffusion™ Cloud . The Diffusion Cloud server evaluates the query and subscribes those currently connected client sessions whose session properties match the filter to the topic or topics.
The filter is evaluated only once. Clients that subsequently connect or clients whose properties change are do not cause the subscription request to be reevaluated. Even if these clients match the filter, they are not subscribed.
Managing all subscriptions from a separate control session
You can prevent client sessions from subscribing themselves to topics and control all subscriptions from a separate control client session that uses SubscriptionControl feature to subscribe clients to topics.
To restrict subscription capability to control sessions, configure the following permissions:
- Grant the permission
- Grant the
This can either be granted for the default path scope or more selectively to restrict the topic selectors the control session can use.
permission
- Grant to the appropriate topics.
- Deny the
Do not assign the session a role that has the
permission for the default path scope. This prevents the session from subscribing to all topics using a wildcard selector.
permission by
default. - Optionally, grant the permission to specific branches of the topic tree to which the session can subscribe freely.