Q-1). What is RabbitMQ?
A-1). RabbitMQ is an open-source message broker where the applications communicate for data transfer or message transmission. This messages can hold any type of information and this messages are consumed by the recipient.
Q-2). When and why to use RabbitMQ?
A-2). Message queuing is useful to exchange a message between several applications. There can be more than one publisher applications who are publishing messages in the queue. And the consumer are consuming those messages from the queue. Even the Consumer can be hosted in a different server. Even also it can be written in different language in compare to the language used by the publisher. Message broker is independent of all this headaches. You create a message, publish the message in the Queue. Consumer will consume the message if it is of proper structure, otherwise it will throw error.
Q-3). What is binding and routing key?
A-3). Binding Key is used to set up to connect a queue to an exchange. Routing Key is an attribute information that the exchange used to determine how to route the message to queues.
Q-4). What is a RabbitMQ Channel?
A-4). Channel enable to have a single connection with RabbitMQ Server. It holds one connection per client process and many channels in that process.
Q-5). What is a dead letter queue in RabbitMQ?
A-5). Dead Letter Queue (DLQ) is referred to an undelivered message queue. It is a holding queue of messages that can not be sent to their destinations for some reason.
In other words, Dead Letter Queue is used to store messages that satisfy one or more of the following failure criteria:
- Messages sent to the queue that doesn’t exist.
- Queue length limit exceeded.
- Message length limit exceeded.
- Message is rejected by another queue exchange.
- Message reaches a threshold read counter number so it is not consumed. It is also called as “back out queue“.
Q-6). What is Exchange and what are the types of exchange?
A-6). Exchange is used to route different messages to the various queues. An exchange receives the message from the publisher request and then it routes to the respective queues. A binding is a linkage between an exchange and a Queue.
There are 4 types of exchanges. They are as follows:
- Direct: Direct Exchange transfer messages to the queues on the basis of the routing key. It means that, the messages will route to those queues whose binding key exactly matches with the message’s routing key
- Fanout: A fanout sends messages to all queues linked to it.
- Topic: The Topic matches the wildcard between the Binding Key and the Routing Key
- Header: Headers exchange use the routing attributes of the message header
Q-7). Which protocol RabbitMQ uses?
A-7). RabbitMQ uses AMQP (Advance Message Queuing Protocol). Its an open standard layer used to communicates date across network by means of byte stream.
Q-8). What is RabbitMQ Vhost?
A-8). Virtual Host in AMQP is a namespace for objects such as Exchange, Queues and Bindings.
Q-9). How RabbitMQ differs from ActiveMQ?
A-9). Both RabbitMQ and ActiveMQ is an open source broker with support of several protocols. The difference is RabbitMQ is written in Erlang and ActiveMQ is written in Java.
Q-10). What is STOMP?
A-10). STOMP (Simple Text Oriented Message Protocol) is used to provide a format for communication between the STOMP Clients with the STOMP Message brokers.
Q-11). What is ZeroMQ?
A-11). A high-performance asynchronous messaging library, ZeroMQ is developed by iMatrix to be used in distributed or concurrent applications. This cross-platform library uses sockets to carry atomic messages across various transports like in-process, inter-process, TCP and multicast. ZeroMQ is developed by a large community of developers written in C++.
Q-12). What are the list of design patterns used by RabbitMQ?
A-12). RabbitMQ follows 2 types of design patterns which are as follows:
- One-Producer to One-Consumer Model: This model is used to deliver each task to exactly one worker. The exchange types are as follows:
- Round-Robin: In this pattern, RabbitMQ dispatches each message to the next consumer in sequence.
- Next Available Worker: In this type, RabbitMQ won’t give more than one message to the worker at a time
- One-Message To Multiple-Consumers Model: This model is used to deliver one message to multiple consumers. The exchange types are as follows:
- Publisher/Subscribe: In this pattern a Publisher sends a message to the set of Subscribers.
Q-13). Is RabbitMQ support MQTT (Message Queue Telemetry Transport)?
A-13). RabbitMQ supports MQTT 3.1.1 through a plugin of core distribution.
Q-14). Is RabbitMQ persistent?
A-14). By default, RabbitMQ messages are not persistent. To make it persistent you need to set the delivery mode to persistent. Then even you restart the queue still the message will be there.
Q-15). Is RabbitMQ uses database?
A-15). RabbitMQ doesn’t store messages but writes messages to a disk in 2 ways:
- Messages published in delivery_mode = 2
- Memory pressure causes RabbitMQ to run out of RAM and transfers messages to the disk to free up RAM.
Q-16). Does RabbitMQ is PUSH or PULL?
A-16). RabbitMQ uses a PUSH template. Kafka uses PULL template.
Q-17). Is RabbitMQ and ESB?
A-17). RabbitMQ is an open-source active message broker and Mule is an ESB (Enterprise Service Bus).
Q-18). What is Synchronous and Asynchronous Messaging?
A-18). Synchronous Messaging is a two way communication, where sender sends a message to the receiver and receiver receives the message and reply back to the sender. Whereas, in case of Asynchronous messaging, the sender sends the message and doesn’t require an immediate response from the receiver.
Q-19). What is Point to Point Communication?
A-19). Point-to-Point connection is a communications between two communication endpoints/nodes.
Q-20). How RabbitMQ differs from Kafka?
A-20). RabbitMQ is a lightweight open source message broker supports different types of protocols like AMQP, MQTT, STOMP. Whereas, Kafka on other hand handles large volume of messages to be stored and distributed.