{"action":"created","issue":{"url":"https://api.github.com/repos/fusesource/mqtt-client/issues/28","labels_url":"https://api.github.com/repos/fusesource/mqtt-client/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/fusesource/mqtt-client/issues/28/comments","events_url":"https://api.github.com/repos/fusesource/mqtt-client/issues/28/events","html_url":"https://github.com/fusesource/mqtt-client/issues/28","id":26601958,"number":28,"title":"Client does not recover from lost network connection","user":{"login":"mfeingold","id":135903,"avatar_url":"https://avatars.githubusercontent.com/u/135903?v=3","gravatar_id":"","url":"https://api.github.com/users/mfeingold","html_url":"https://github.com/mfeingold","followers_url":"https://api.github.com/users/mfeingold/followers","following_url":"https://api.github.com/users/mfeingold/following{/other_user}","gists_url":"https://api.github.com/users/mfeingold/gists{/gist_id}","starred_url":"https://api.github.com/users/mfeingold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfeingold/subscriptions","organizations_url":"https://api.github.com/users/mfeingold/orgs","repos_url":"https://api.github.com/users/mfeingold/repos","events_url":"https://api.github.com/users/mfeingold/events{/privacy}","received_events_url":"https://api.github.com/users/mfeingold/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-01-30T14:36:03Z","updated_at":"2015-06-11T20:02:56Z","closed_at":null,"body":"Steps to replicate:\r\n1. Establish the connection:\r\n`\r\n        MQTT mqtt = new MQTT();\r\n        MQTT mqtt = new MQTT();\r\n        mqtt.setHost(host, port);\r\n        mqtt.setUserName(user);\r\n        mqtt.setPassword(password);\r\n\tmqtt.setClientId(\"TestClient_1\");\r\n\tmqtt.setCleanSession(false);    // durable topic\r\n        CallbackConnection connection = mqtt.callbackConnection();\r\n        etc...\r\n`\r\n2. run the program and let it establish a connection. You can watch pings coming and going\r\n3. pull the wire and the connection time out on both ends\r\n4. re-establish the connection\r\n\r\nAt this point the client tried to reconnect. In tracer I can see the connecting message, 'login accepted' message and it even receives the messages that were waiting in the queue, but then out of nowhere comes another connect message and it tries to login again and this time the login is rejected - obviously because the connection uses the same clientID.\r\n\r\nI tried to run this scenario on multiple computers and effects differ. Sometimes it just works.\r\n\r\nAlso if instead of pulling the wire I close / restart broker, it works fine.\r\n\r\nGuys, this seems to be a showstopper. I like your client, but I will have to switch to paho if I cannot resolve this promptly"},"comment":{"url":"https://api.github.com/repos/fusesource/mqtt-client/issues/comments/111260220","html_url":"https://github.com/fusesource/mqtt-client/issues/28#issuecomment-111260220","issue_url":"https://api.github.com/repos/fusesource/mqtt-client/issues/28","id":111260220,"user":{"login":"behrad","id":2151889,"avatar_url":"https://avatars.githubusercontent.com/u/2151889?v=3","gravatar_id":"","url":"https://api.github.com/users/behrad","html_url":"https://github.com/behrad","followers_url":"https://api.github.com/users/behrad/followers","following_url":"https://api.github.com/users/behrad/following{/other_user}","gists_url":"https://api.github.com/users/behrad/gists{/gist_id}","starred_url":"https://api.github.com/users/behrad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behrad/subscriptions","organizations_url":"https://api.github.com/users/behrad/orgs","repos_url":"https://api.github.com/users/behrad/repos","events_url":"https://api.github.com/users/behrad/events{/privacy}","received_events_url":"https://api.github.com/users/behrad/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T20:02:56Z","updated_at":"2015-06-11T20:02:56Z","body":"we are using mqtt-client in beta production on Android devices, not seen a problem yet when switching \r\nwifi/data on/off... (no wire to pull out!) \r\n\r\nI like the auto-reconnection feature which paho lacks."}}