using rabbitmq in android for chat

前端 未结 3 1746
孤独总比滥情好
孤独总比滥情好 2021-02-06 09:55

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 p

相关标签:
3条回答
  • 2021-02-06 10:01

    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

    0 讨论(0)
  • 2021-02-06 10:03

    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

    0 讨论(0)
  • 2021-02-06 10:08

    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.

    0 讨论(0)
提交回复
热议问题