Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Android - Paho Mqtt client does not receive messages once network connectivity changes (mobile data disabled and enabled again)

Marc,

Yes, I am stopping and restarting the communication channel with pure Java too. It does not disconnect the connection. I already have code in connectionLost method which never get triggered during the use case. And when communication channel is back on I get all the messages published while channel was down.

Ian,

Which Android service you are taking about?? I am not using Paho Android Service interface, just mqtt-client-0.4.1 along with a simple Android Activity.



On Fri, Aug 8, 2014 at 8:18 PM, Marc L Cohen <mlcohen@xxxxxxxxxx> wrote:

But what about the non-Clean session issue? Will Android always be non-clean session? Or just going to document the limitation and just auto-reconnect if the session is not a clean one?




Marc L. Cohen
MessageSight Test/Development
Internet:mlcohen@xxxxxxxxxx
also at:teddybbear@xxxxxxx
(512) 286-5744 (T/L 363-5744)
FAX (512) 973-4293


Inactive hide details for Ian Craggs ---08/08/2014 09:38:37 AM---That the Android service does not reconnect automatically I thIan Craggs ---08/08/2014 09:38:37 AM---That the Android service does not reconnect automatically I think is an  omission which we should fi

From: Ian Craggs <icraggs@xxxxxxxxxxxxxxxxxxxxxxx>
To: paho-dev@xxxxxxxxxxx
Date: 08/08/2014 09:38 AM

Subject: Re: [paho-dev] Android - Paho Mqtt client does not receive messages once network connectivity changes (mobile data disabled and enabled again)
Sent by: paho-dev-bounces@xxxxxxxxxxx




That the Android service does not reconnect automatically I think is an omission which we should fix.

I'll raise a bug for it.

Ian


On 08/08/2014 02:59 PM, ನಾಗೇಶ್ ಸುಬ್ರಹ್ಮಣ್ಯ (Nagesh S) wrote:
    When you reenable the connection, are you explicitly re-issuing a MQTT connect ?


    On Fri, Aug 8, 2014 at 7:04 PM, Prashant Kedia <prashantkedia22@xxxxxxxxx> wrote:
      Hi,

      I am using Mosquitto Mqtt along with Paho API to receive push messages on android device. But as soon as the network connectivity changes it stops receiving messages. Here are the steps to reproduce the issue with simple test case:

      1) Create a simple activity.
      2) On Activity StartUp connects to mosquitto test server (test.mosquitto.org:1883) through paho API.
      3) Subscribe to some topic.
      4) Publish some message to the topic.

      Result: Mqtt Client receives all the messages published to the topic. Now

      5) Disable internet connection on the mobile (mobile data)
      6) Publish some message to the topic.
      7) Reconnect internet.

      Result: Client Does not receive any message published after internet connection was disabled.

      As KeepAliveInterval has been kept to high value (30 minutes), it should receive all messages after reconnecting to the internet.

      The same use case (same code) is working for simple java project (non-android) where I disable internet on my laptop to run the use case.

      Any idea why it is not working on android device??? Am I missing something?

      More Info:

      1) Using mqtt-client-0.4.1
      2) Android target API level 11
      3) Not putting device to sleep mode during the test.
      4) Does not get any call in connectionLost callback and all the 4 threads of mqtt callback are running throughout the test case i.e connection the the mosquitto server is intact.

      --
      Thanks and Regards,
      Prashant



      _______________________________________________
      paho-dev mailing list

      paho-dev@xxxxxxxxxxx
      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

      https://dev.eclipse.org/mailman/listinfo/paho-dev



    _______________________________________________
    paho-dev mailing list
    paho-dev@xxxxxxxxxxx
    To change your delivery options, retrieve your password, or unsubscribe from this list, visit
    https://dev.eclipse.org/mailman/listinfo/paho-dev

--
Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Committer on Paho, Mosquitto

_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev



--
Thanks and Regards,

Prashant Kedia
Co-Founder and Developer
Bizlers Technologies Pvt. Ltd.

GIF image


Back to the top