Software Developers => Let's understand, ๐๐๐๐๐ข๐ญ๐๐ (Give it a read ๐)
RabbitMQ =>born in 2007 => a joint venture between LShift and CohesiveFT, aimed to provide an open-source, reliable message broker implementing the AMQP standard.
RabbitMQ is written in Erlang.
It is -
โพ an open-source message broker software that implements the Advanced Message Queuing Protocol (AMQP).
** AMQP => a binary protocol, meaning it encodes data in a compact binary format for efficient transmission over networks.
โพ a robust intermediary between different applications or components of a system, facilitating the exchange of messages in a reliable and scalable manner.
โพ known for its fault tolerance, concurrency and distributed systems capabilities.
โพ operating primarily on a ๐ฉ๐ฎ๐ฌ๐ก-๐๐๐ฌ๐๐ ๐ฆ๐จ๐๐๐ฅ for message delivery
๐ ๐๐จ๐ซ๐ ๐๐จ๐ฆ๐ฉ๐จ๐ง๐๐ง๐ญ๐ฌ
[1.] Producer
โพ An application that creates and sends messages to RabbitMQ.
[2.] Consumer
An application that receives messages from RabbitMQ.
[3.] Queue
โพ A named buffer where messages are stored.
[4.] Exchange
โพ The component that receives messages from producers and routes them to the appropriate queues based on specific rules.
โพ The heart of an exchange is its routing algorithm, which determines how messages are directed to queues.
Main exchange types -
โพ Direct - Matches the routing key of the message exactly with the binding key of a queue.
โพ Fanout - Broadcasts the message to all queues bound to the exchange.
โพ Topic - Uses wildcards (* and #) to match routing keys to binding keys.
[5.] Binding
A link between a queue and an exchange, specifying the routing criteria for messages.
๐ ๐๐จ๐ฐ ๐๐ญ ๐๐จ๐ซ๐ค๐ฌ ๐๐ง๐ญ๐๐ซ๐ง๐๐ฅ๐ฅ๐ฒ?
1. The producer connects to RabbitMQ and publishes a message to an exchange.
2. The message includes routing information (e.g. => a routing key).
3. The exchange receives the message and examines the routing key.
4. Based on its configuration and bindings, the exchange determines which queues should receive the message.
5. The message is delivered to the designated queues, where it waits to be consumed.
6. Consumers connect to RabbitMQ and subscribe to specific queues.
7. When a message becomes available in the queue, RabbitMQ delivers it to one of the subscribed consumers.
8. After a consumer processes a message, it sends an acknowledgment to RabbitMQ, confirming that the message was successfully received and processed.
9. If no acknowledgment is received within a specified time, RabbitMQ can redeliver the message to another consumer.
๐ ๐
๐ฅ๐จ๐ฐ ๐๐จ๐ง๐ญ๐ซ๐จ๐ฅ
1. RabbitMQ uses credit-based flow control to prevent consumers from being overwhelmed with messages.
2. Consumers request a certain number of messages (credit) from the broker, and the broker delivers messages up to that limit.
3. When the consumer acknowledges a message, it receives additional credit, allowing the broker to send more messages.
Best DSA RESOURCES: https://topmate.io/coding/886874
All the best ๐๐
Post #1048
6.84K
- ๐ 8
- ๐ 7
- โค 2