Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using rabbitmq in android for chat

We have implemented rabbitmq chat in android. but java client of rabbitmq is power hungry.is rabbitmq good for android chat?. we have used direct exchange individual queue for persons and individual routing keys. what is the best design pattern for one to one chat in rabbitmq. and also ways to reduce battery usage

like image 207
surendar Avatar asked Apr 18 '14 17:04

surendar


People also ask

Is RabbitMQ a messaging system?

RabbitMQ is a messaging broker - an intermediary for messaging. It gives your applications a common platform to send and receive messages, and your messages a safe place to live until received.

Can RabbitMQ store messages?

Every RabbitMQ node has a data directory that stores all the information that resides on that node. A data directory contains two types of data: definitions (metadata, schema/topology) and message store data.

How can I listen to RabbitMQ?

basicConsume(queueName, true, consumer); In a few words, you have to: create a queue, in this case anonymous queue. bind the queue to your exchange.


2 Answers

I don't think that use RabbitMQ directly for developing a chat is the better solution.

There are other solution more light please read this post about MQTT.

Another standard solution is use XMPP protocol (for example whatsup uses a custom XMPP).

We made some test and we also had some problem about battery consuming.

BTW, you can mix the technologies, mixing RabbitMQ as back-end and some other server (XMPP,MQTT) as front-end.

Read this post about the MQTT.

MQTT used by Facebook Messenger

EDIT

I would add this post MQTT vs. XMPP Which Should I Choose?

EDIT2

Please read also this and this on the official rabbitmq-group

like image 82
Gabriele Santomaggio Avatar answered Sep 22 '22 17:09

Gabriele Santomaggio


Maybe you could combine RabbitMQ with GCM to save power as GCM gets triggered by the system and doesn´t need to keep any extra connection alive.

For example:

The app gets notified via GCM when any new event comes in. Then a new Rabbit connection gets established, retrieving the data and timeouting after a short while again, if no messages are coming in again.

So the actual "hungryness" exists only for a short moment and only when neccessary.

You can also analyze which users are tending to always write multiple messages close behind one other and vary the timeout based on that value

like image 45
Marian Klühspies Avatar answered Sep 20 '22 17:09

Marian Klühspies