Smartym Pro  /  Blog  /  Mobile  / 

Using RabbitMQ in chat applications and messenger app architecture

Mobile messengers have become very popular recently. At the moment, there are plenty of mobile messengers, such as Viber, WhatsApp, or Telegram, each having its pros and cons.

Certainly, in order to take a high place among popular messengers, an application must not only have a perfect design and reliable performance but also be easily scalable and able to support heavy loads with the increase of user base.

Implementing such functionality is a real challenge since it requires not only a lot of time for development and testing, and high qualification of developers, but also integration with reliable platforms for message delivery.

In our case, the best way was to use an open-source message broker RabbitMQ which supports different protocols of message delivery and has plenty of client libraries allowing to integrate it with popular mobile platforms (Android, iOS).

This solution allowed us to pay more attention to architecture and business logic development and ensure stable work of messages delivery and easy scaling.

According to RabbitMQ tutorial, it allows easy implementation of the following functions:

– group chats;
– message delivery check;
– receiving a message from the user while offline;
– receiving a message on all client applications at the same time (iOS, Android);
– preventing unnecessary messages sending, as well as message delivery optimization in case of disconnection from RabbitMQ, e.g. during Internet cut-off.

At the same time, the development process always has some challenges. For example, during the development process, our team had to implement communication of RabbitMQ with the server side, as well as communication with an Android application using AMQP protocol.

At first, we were planning to use AMQP Objective-C wrapper for librabbitmq-c library for iOS, but it turned out to have lots of latent problems and bugs – this problem was solved by replacing AMQP protocol with MQTT. One should note that we didn’t have such difficulties with the client library on Android.

Also, we had a challenge of correct message delivery configuration, which required the right choice of Quality of service (QoS). As a result, we developed a reliable system supporting heavy loads and their increase due to the expansion of the user base and user activity peaks.

Using RabbitMQ in message application architecture helps to solve the problem of message delivery with the support of multi-user conversations and users with several clients switched on at the same time, with writing a minimum of code in the server application.

Thus, RabbitMQ message broker is an effective solution for messenger development and implementation of many other tasks related to IoT. It completely solves the issue of communication with the application, which allows to pay more attention and dedicate more time to business logic implementation of the messenger app.

In case you are interested in creating a  messaging app, we have deep expertise in mobile development. Write to us and together we will create a complete working solution with great respect to your ideas, even the craziest ones.

author avatar
Smartym Marketing Team