[rabbitmq-discuss] RabbitMQ as Android Service - keep-alive/heartbeat
m.luchak at smartasking.com
m.luchak at smartasking.com
Thu Apr 19 13:42:06 BST 2012
Hi Simon,
Yup, we are running TCP keepalives on the server... It's the Android side that we are questioning the proper way to implement..
We will just implement writeFrame(new Frame(AMQP.FRAME_HEARTBEAT, 0));
when the service wakes up..
thanks very much,
Matthew
-----Original Message-----
From: "Simon MacMullen" <simon at rabbitmq.com>
Sent: Thursday, April 19, 2012 8:12am
To: m.luchak at smartasking.com
Cc: rabbitmq-discuss at lists.rabbitmq.com
Subject: Re: [rabbitmq-discuss] RabbitMQ as Android Service - keep-alive/heartbeat
On 19/04/12 12:49, m.luchak at smartasking.com wrote:
> We are running RabbitMQ as a background service on Android to
> prinicpally receive notifications. Is there something similar to
> keep-alive that we can implement to verify if the consumer is still
> connected and reset the connection timeout on the server?
>
> It seems that the default method to do this is with heartbeat but the
> timer attribute of heartbeat doesn't work in the Android service
> scenario where the service is "woken up" every X minutes to test the
> connection. Using heartbeat we would need to leave Android running
> constantly and this defeats the purpose...
>
> Soo.. Is there "The Right Way" to ping the server when a background
> service is woken up or do we need to roll our own?
It's possible that enabling TCP keepalives will help:
http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2012-January/017138.html
But you may need them on the client too, which may in turn require
waking the client up; I'm not sure how that works on Android.
Cheers, Simon
--
Simon MacMullen
RabbitMQ, VMware
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120419/cff45adb/attachment.htm>
More information about the rabbitmq-discuss
mailing list