Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » Android - Paho Mqtt client does not receive messages once network connectivity changes.(On Android Paho Mqtt client does not receive messages after disabling and then enabling mobile data.)
Android - Paho Mqtt client does not receive messages once network connectivity changes. [message #1405778] Fri, 08 August 2014 06:51
Prashant Kedia is currently offline Prashant KediaFriend
Messages: 1
Registered: August 2014
Junior Member
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?

Note:

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.
Previous Topic:Eclipse Paho MQTT Java ME 8 Client
Next Topic:Python client not working in IronPython
Goto Forum:
  


Current Time: Sat Nov 25 00:29:27 GMT 2017

Powered by FUDForum. Page generated in 0.02056 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software