using rabbitmq in android for chat

旧街凉风 提交于 2019-12-03 07:41:15
Gabriele

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!