Skip to main content

Rabbit MQ

What is Rabbit MQ?

RabbitMQ is an open-source software used as a message broker that implements the Advanced Message Queuing Protocol (AMQP). RabbitMQ provides features for routing messages between two applications and sending messages from one application to another. It is a frequently used tool to reduce the load and time of message delivery with web applications. RabbitMQ is commonly used in the case of processing long-running tasks in the background and for communication between applications, especially in the context of microservices.

Exchange

An exchange in RabbitMQ is a component used as a message router. The exchange manages how messages will be forwarded to the destination, which can be a queue or another exchange. Exchanges have several types, namely Fanout, Direct, Topic, and Headers, each of which has a different way of routing.

rabbitmq

Routing in RabbitMQ can be done through several exchange types, namely Fanout, Direct, Topic, and Headers. The following are the routing methods for each exchange type:

  1. Fanout: Fanout exchange is an exchange type that has simple routing and is independent of the message content. Messages forwarded to a fanout exchange will be directly forwarded to all queues bound to the exchange. Fanout exchanges do not use routing keys.
  2. Direct: Direct exchange is a type of exchange that has more complex routing and depends on the message content. Messages forwarded to a direct exchange will be directly forwarded to the queue that has the same routing key as the message. Direct exchanges do not use wildcards.
  3. Topic: Topic exchange is a type of exchange that has more complex routing and depends on the message content. Messages forwarded to a topic exchange will be forwarded to the queue that has the routing key corresponding to the message. Topic exchanges use wildcards, namely # (hash) and _ (star). # uses wildcards to match zero or more words mostly, while _ uses wildcards to match one word.
  4. Headers: Headers exchange is a type of exchange that has more complex routing and depends on the message content. Messages forwarded to a headers exchange will be forwarded to a queue that has headers corresponding to the message. Headers exchange uses a binding key that corresponds to the message header.
tip

The most commonly used exchange types are Topic and Fanout.

RabbitMQ Settings

Arkademi RabbitMQ

Here is the URL link for the Arkademi RabbitMQ:

note

Ask the backend engineer for the access.

https://rabbit-mq.arkademi.com/

The work process of using the RabbitMQ by the team is illustrated in the following diagram, along with the detailed settings.

rabbitmq for team

NameDetail
ExchangeTopic or Fanout
Queue Namemobile_app_queue
Virtual Host/mobile

Mobile App Setting

The process of using RabbitMQ and configuring its mobile application is illustrated in the image below, along with a detailed table outlining its settings.

rabbitmq for eng

NameDetail
HeartbeatPeriod30s
ReconnectWaitTime5s
MaxChannel0
MaxFrameSize4096
ConsumerTagdeviceName_uniqueId

Written by Media
Contributor is Listyo
25 April 2024