RabbitMQ by Example Flashcards
(39 cards)
What is RabbitMQ?
It is a open-source messaging queue system.
What protocol does RabbitMQ is based on?
AMQP protocol - which stands for advanced message queue protocol.
What are the main features of RabbitMQ?
Reliability: messages can be persisted and even the server can be restarted. Also supports message delivery acknowledgement to ensure the message was received.
Routing: Uses exchanges to route the messages to the proper queues.
Clustering and High Availability: Many instances of rabbit MQ can act as one, which tolerate failures without loosing messages.
Management Web Interface: Default UI that comes with the rabbitMQ server.
Command line tool: Called RabbitMQ ctrl and admin - offer the same level of configuration as the web interface but here you can do scripting.
Which languages have the rabbitMQ clients?
Pretty much all of them.
What is AMQP?
Network protocol that enables applications to exchange messages to other clients via a server.
What is MSMQ?
MSMQ was availablr to developers on 1997. ensure successful message delivery by placing failed messages on different queues. Also supports transactions.
What is the difference between rabbitmq and MSMQ?
centralized and descentralized; multi platform vs windows only; standard based (AMQP) vs no standards;
Which language was rabbitmq written on?
Erlang.
What are some common functions of RabbitMQ?
Declare, list and delete rmq entities;
Queue and exchange monitoring;
Send and receive messages;
Monitor Erlang processes, file descriptors and memory use;
Force close connections, and purge queues.
What is a binding?
It is the connection between the queue and the exchange.
Where is the actual message stored?
In the Payload.
What is the requeue concept?
When true it means that you’ll read the message and leave it in the queue, otherwise remove from the queue (similar to pm_pmnoremove)
What is the common path a messages goes through until it gets to a consumer?
Publisher -> exchange -> routes -> Queue -> Consumer
What happens when a message can’t get to a consumer? Is it configurable?
it is configurable, can be returned to the sender, dropped or placed on a different queue.
What is a routing key?
Acts like a filter. It is a another way to filter further a message inside a queue.
What are the different types of exchanges?
Direct exchanges: Based on message routing key;
Fanout exchanges: Post the message to all queues that are connected to it (a copy of the message is posted on all queues).
Topic Exchanges: Wild cards on routing key to be able to post the same message on different queues (which also might have wildcards).
Header Exchanges: Routing key is ignored and the header will contain the routing keys (might have many) which are customized (e.g: material = wood).
What is an exchange? What does it do? What does it use to route stuff?
Exchanges are message routing agents, defined by the virtual host within RabbitMQ. An exchange is responsible for routing the messages to different queues with the help of header attributes, bindings, and routing keys. Take a message and route to one or more queues.
What are the four attributes of an exchange?
Name: Name of the exchange;
Durability: Persisting the message to disk;
Auto-delete: Delete message when not needed
Arguments: These are message broker-dependent
When the fanout exchange is ideal?
For broadcasts. E.g: sending a chat message to a group of people.
What is a queue? Does it work in a li-fo mode?
Queue is where the messages are posted. Works in a first in first out basis.
What are the additional properties the queues provides in extra to the exchange?
Name: name of the queue;
Durable: Persisting the queue to disk;
Exclusive: Exclusive to one connection. Delete queue when not needed;
Auto Delete: Queue deleted when consumer unsubscribes.
What is the durable concept means in RabitMQ
Means it will survive if the server goes down.
What happens when a queue is declared? What happens if it already exists?
The queue is created. When already created nothing happens.
Do I need to define a queue name?
No… the broker can generate it automatically.