This is the constructor for the DefaultSubscriptionManager class.
This method clears all the managed subscriptions so that in case of the disconnection there will be no subscriptions to restore.
This method sets/gets the resubscription timeout value. It should be bigger or equal to zero. If it is equal to zero, it never times out.
The timeout value (in milliseconds).
The subscription timeout.
This method performs the subscription to a topic.
The subscription command header with all command data.
The message handler callback function. Not required in case of 'replace' or 'pause' subscriptions.
This method unsubscribes from a topic using the subscription id.
The subscription id.
DefaultSubscriptionManager is used to resubscribe and manage client subscriptions in case of a unintended disconnection.
// create a client const client = new Client('my-client'); // Create and assign the subscription manager client.subscriptionManager(new DefaultSubscriptionManager()); // ... access the subscription manager later client.subscriptionManager().clear();