[rabbitmq-discuss] RabbitMQ as Android Service - keep-alive/heartbeat

Simon MacMullen simon at rabbitmq.com
Thu Apr 19 13:12:51 BST 2012


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


More information about the rabbitmq-discuss mailing list