Pregunta

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

¿Fue útil?

Solución

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

Otros consejos

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

I think chat applications for real time delivery is sending messages over network instantly rather than reliability. Reliability means confirm receiving against delivery. But in real time chat application does not make sure it. RabbitMQ is a message broker server and it is dedicated for reliability first, but it is not responsible for real time message communication. You may use RabbitMQ for real time communication but sometimes may not be in real time.

You can use STOMP-WebSocket(For simple messaging), Firebase(easy development for instant messaging), but most professional and usable protocol is XMPP(Extensible Messaging and Presence Protocol) for real time communication.

If you have any suggestion or query against this answer, let me comment bellow.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top