Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] paho-dev Digest, Vol 46, Issue 2

Thanks guys for responding!

Right now I am using MqttAsyncClient directly in my custom service code. I presume instead of that, I should use MqttAndroidClient. Is that what you guys are pointing at? When I dig into the code, I see MqttAndroidClient uses MqttConnection, which in turn calls MqttAsyncClient, but with an instance of AlarmPingSender class, which hints at keeping the connection alive. Maybe that can help fix my problem. I will try this out, if that is what's suggested.

Hi Manuel,
What are the problems with reconnection that you are referring to? I'll be listening to the connectivity status change event and stop/start the service accordingly. That should take care of the reconnection, I guess. My main intent is to keep the service active when and if you have an active data connection. The service won't be concerned with any other events ike orientation change, etc.

Regards,

On Mon, Oct 5, 2015 at 5:01 PM, <paho-dev-request@xxxxxxxxxxx> wrote:
Send paho-dev mailing list submissions to
        paho-dev@xxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
        https://dev.eclipse.org/mailman/listinfo/paho-dev
or, via email, send a message with subject or body 'help' to
        paho-dev-request@xxxxxxxxxxx

You can reach the person managing the list at
        paho-dev-owner@xxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of paho-dev digest..."


Today's Topics:

   1. Android MQTT service disconnection issue with QoS=1 and
      RabbitMQ server (Milind Utsav)
   2. Re: Android MQTT service disconnection issue with QoS=1 and
      RabbitMQ server (De Alti, Cristiano)
   3. Re: Android MQTT service disconnection issue with QoS=1 and
      RabbitMQ server (saurabh patil)
   4. Re: Android MQTT service disconnection issue with QoS=1 and
      RabbitMQ server (Prashant Kedia)


----------------------------------------------------------------------

Message: 1
Date: Mon, 5 Oct 2015 12:44:36 +0530
From: Milind Utsav <milind.utsavbk@xxxxxxxxx>
To: paho-dev@xxxxxxxxxxx
Subject: [paho-dev] Android MQTT service disconnection issue with
        QoS=1 and       RabbitMQ server
Message-ID:
        <CADgqjRCER_QmjEZPkKuL7CZKt3jZ+mFiA5NcDO0LdMPU5=oxYw@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="utf-8"

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
+91-9742565861 (M)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dev.eclipse.org/mailman/private/paho-dev/attachments/20151005/aedeb301/attachment.html>

------------------------------

Message: 2
Date: Mon, 5 Oct 2015 09:54:41 +0000
From: "De Alti, Cristiano" <Cristiano.DeAlti@xxxxxxxxxxxx>
To: "paho-dev@xxxxxxxxxxx" <paho-dev@xxxxxxxxxxx>
Subject: Re: [paho-dev] Android MQTT service disconnection issue with
        QoS=1 and RabbitMQ server
Message-ID: <561248E0.9070503@xxxxxxxxxxxx>
Content-Type: text/plain; charset="windows-1252"

Hi,
  I think you need to implement a reconnect logic in the Android app (unless such a logic is already there).
Paho does not attempt to reconnect automatically.

Regards,
  Cristiano

On 05/10/2015 09:14, Milind Utsav 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
+91-9742565861 (M)



_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx<mailto: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

--
Cristiano De Alti
Principal Software Engineer

direct:    +39 0433 485468
email: cristiano.dealti@xxxxxxxxxxxx<mailto:cristiano.dealti@xxxxxxxxxxxx>

EUROTECH
Imagine.Build.Succeed.
HEADQUARTERS
EUROTECH S.p.A. ? Via Fratelli Solari, 3/a | 33020 Amaro UD | Italy | Tel. +39. 0433 485411  | Fax +39. 0433 485499 |
Cap. Soc. 8.878.946,00 ? I.V. | P.IVA / C.F.: IT 01791330309 | REA Udine 196115
www.eurotech.com<http://www.eurotech.com/>
____________________________________

Il presente messaggio ed ogni suo allegato sono da intendersi inviati esclusivamente agli effettivi destinatari e potrebbero essere soggetti a restrizioni legali. Se avete ricevuto questo messaggio per errore vi invitiamo a darne immediata notifica al mittente e cancellarlo dal vostro sistema. Qualsiasi altro uso di questo messaggio da parte vostra e' strettamente proibito.

This e-mail, and any file attached to it, is meant only for the intended recipient of the transmission and may be a communication privileged by law. If you have received it in error, please notify the sender immediately and delete the original from your system. Any other use of this e-mail by you is strictly forbidden.
____________________________________

Per favore, pensate all?ambiente prima di stampare questa e-mail. Please consider the environment before printing this e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dev.eclipse.org/mailman/private/paho-dev/attachments/20151005/15cacc80/attachment.html>

------------------------------

Message: 3
Date: Mon, 5 Oct 2015 16:21:20 +0530
From: saurabh patil <saurabhpatil786@xxxxxxxxx>
To: General development discussions for paho project
        <paho-dev@xxxxxxxxxxx>
Subject: Re: [paho-dev] Android MQTT service disconnection issue with
        QoS=1 and RabbitMQ server
Message-ID:
        <CABqFiPvVhXdeO26VK=BxGxcp0UsJ5Y-DPViJ4dB_k=7odJJ=nQ@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="utf-8"

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
> +91-9742565861 (M)
>
> _______________________________________________
> 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.
www.bizlers.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dev.eclipse.org/mailman/private/paho-dev/attachments/20151005/612e2b30/attachment.html>

------------------------------

Message: 4
Date: Mon, 5 Oct 2015 17:01:12 +0530
From: Prashant Kedia <prashantkedia22@xxxxxxxxx>
To: General development discussions for paho project
        <paho-dev@xxxxxxxxxxx>
Subject: Re: [paho-dev] Android MQTT service disconnection issue with
        QoS=1 and RabbitMQ server
Message-ID:
        <CAJQB0YJq3pNwT+YJt+qMWN78=u47X59RZX=c6PX_V5G0bsQn+Q@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="utf-8"

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
>> +91-9742565861 (M)
>>
>> _______________________________________________
>> 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.
> www.bizlers.com.
>
>
>
> _______________________________________________
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dev.eclipse.org/mailman/private/paho-dev/attachments/20151005/e72b2c16/attachment.html>

------------------------------

_______________________________________________
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

End of paho-dev Digest, Vol 46, Issue 2
***************************************



--
Milind Utsav
+91-9742565861 (M)

Back to the top