0

Let say i have a android app installed on app and user has subscribed to many topic. Now if user uninstalled app

how can I remove all user specific subscribed topic from broker ? Can i unsubscribe paho JS client subscribe topics using paho Java client ?

In JS side this is how i am connecting and subscribing to my broker

  client.connect({
    userName:user,
    password:password,
    onSuccess:onConnect,
    onFailure:onFailure,
    'willMessage': willMessage
  });

var onConnect = function(frame) {
  client.subscribe("user/"+clientId+"/msg");
};
Manish Kumar
  • 10,214
  • 25
  • 77
  • 147

1 Answers1

1

OK, if your not setting cleanSession to false then subscriptions shouldn't be persisted.

But it sounds like you're looking for something similar to mosquitto's persistent_client_expiration option which says how long to keep this information after a clients last connection.

Not sure if rabbitmq has a similar option

hardillb
  • 54,545
  • 11
  • 67
  • 105
  • What will happen if i uninstall my client ? will that client specific topic will remain be there on broker ? – Manish Kumar Dec 01 '16 at 14:22
  • I've edited the answer as it had a mistake, but but if you have cleanSession set to false then the subscriptions for a given clientId will be kept for ever if the that client never logs on again. The mosquitto option deals with that by expiring things if they are not used. – hardillb Dec 01 '16 at 14:28
  • Then how to deal with this cos chances are that client will simply uninstall the app and all subscribed topics will remain be there in broker and it will put up load on broker performance as there will be growing unused topics? – Manish Kumar Dec 01 '16 at 14:43
  • 1
    `cleanSession` defaults to true so this shouldn't be a problem unless rabbitmq is keeping them, in that case you should raise a defect – hardillb Dec 01 '16 at 14:45