Can a client have more than one subscription at a time?

Follow

A single client can have more than one subscription active at the same time. AMPS delivers messages for all active subscriptions to the client.

The AMPS clients deliver messages for each subscription to the message handler you provide when you create the subscription. This can be the same message handler for all subscriptions, or a different message handler for each subscription.

 

It's important to remember, though, that AMPS treats each subscribe command as a new subscription. For example, consider a case where you subscribe to the orders topic with a filter "/region IN ('US', 'FR', 'UK')" and then subscribe to the orders topic with a filter "/region IN ('BR')". Your client receives messages for all of those regions, on two different subscriptions.

If you want to change the filter on an existing subscription, see the developer's guide for replace subscription, or the FAQ item on changing a subscription.

 

Have more questions? Submit a request

Comments

Powered by Zendesk