Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Android MQTT service disconnection issue with QoS=1 and RabbitMQ server

Are you sending an explicit ping to mqtt broker before keepalive interval passes, in order to keep the connection alive? The thing is, while  android device is in sleep mode (screen is turned off) paho java client api can not send ping to broker. So if you keep your device in sleep mode longer then keepalive interval broker will not receive any ping within keepalive interval and consider it as disconnected.

To make paho java client api work with android you will have to use AlarmManager to acquire a wake lock and send explicit ping before keepalive passes. This is not the only issue while using paha java client with android. You should better use Paho's "Android Service" which takes care of all such issues.
 

On Mon, Oct 5, 2015 at 4:21 PM, saurabh patil <saurabhpatil786@xxxxxxxxx> wrote:
Hi Milind,

You can use paho android service which takes care of above issues. Below is the link

https://eclipse.org/paho/clients/android.

On Mon, Oct 5, 2015 at 12:44 PM, Milind Utsav <milind.utsavbk@xxxxxxxxx> wrote:
I am trying to implement a push notification service for Android clients. The server is RabbitMQ with the MQTT adapter. The client on Android is of course, Paho Java client. The server side is Paho in Python sendin QoS 1 messages.

I couldn't get the connection to work reliably. Every now and then, the connection times out and the client is disconnected. In the RabbitMQ console, I can see that there are no active consumers listening to the topic. The Android client doesn't receive messages post that, until you restart the app, and hence the service. In a real world scenario, I can't expect customers to reopen the app everytime to get the notifications.

Right now, I am having a keepalive duration of 120s, which improved the performance of delivery from when the value was 60 s, but only slightly.

Are there any recommendations as to how I should tune my connections to make them more reliable?

--
Milind Utsav

_______________________________________________
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,

Saurabh Patil
Co-Founder and Developer
Bizlers Technologies Pvt. Ltd.

 

_______________________________________________
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.

Back to the top