RabbitMQ interview Questions and Answers

238 views 17 slides Nov 13, 2022
Slide 1
Slide 1 of 17
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17

About This Presentation

RabbitMQ interview questions and answers.


Slide Content

What is RabbitMQ? RabbitMQ is an open-source message-broker software is also known as message queueing technology. It defines queues to which applications communicate for data transfer, or message transmission. Any kind of information could be included in a message. This message is processed by the recipient application.

When and why to use RabbitMQ? Message queueing is useful when you want to exchange a message for consumption or for balance of loads between workers with multiple recipients. The user is able to take a message from the queue while the producer is in the queue, and start processing. The consumer can be on a different server or on the same server than the publisher. The requested application can be of one language and the consumer application is of other language – the message broker would not care about the application languages, it just send messages between consumer and reciever . Which also reduces the dependencies or coupling between the application.

What Is binding And routing Key? A binding is a “bridge” that you set up to connect a queue to an exchange. The routing key is an attribute message that the exchange examines when determining how to route the message to queues. What is a RabbitMQ channel? They enable you to have a single connection to the RabbiMQ server, but for different parts of your application they have sandboxed communication. Channels are how the RabbitMQ server communicates with your application. It hold one connection (instance) per client process and many channels in that process (instance) Which Protocol RabbitMQ uses? RabbitMQ uses Advanced Message Queuing Protocol (AMQP). Its an open standard layer used to communicates date across network by means of byte stream.

How to implement RabbitMQ retry mechanism? Whenever any data in the message is transmitted that the receiver does not accept, or when a message is sent to a queue that does not exist. The message is retried and sent up to a set number of times. Even if the communication is not received by the recipient but is sent from the sender’s end. Now In such instances, the message queue is marked as undeliverable or deadLetter queue. What is Exchange? Messages are not posted directly in the queue; rather, the user sends messages to the exchange. An exchange is responsible for routing the messages to the various queues. An exchange receives messages from the producer request and routes them by bindings and routing keys to message queues. A binding is a linkage between an exchange and a queue.

What is RabbitMQ Vhost ? A Virtual Host (a.k.a. ‘ vhost ‘) in AMQP is a namespace for objects such as Exchanges, Queues and Bindings. RabbitMQ utilizes more concrete implementation of virtual hosts, through effectively making them “virtual clusters” on top of the broker. How RabbitMQ differs from ActiveMQ? RabbitMQ is open source message broker with support for several protocols, written in Erlang. Whereas ActiveMQ is also open source with support for several protocols, written in Java langauge .

Is RabbitMQ support MQTT (Message Queue Telemetry Transport)? RabbitMQ supports MQTT 3.1.1 through a plugin that ships to the core distribution. Supported MQTT Features: QoS0 and QoS1 publish & consume QoS2 publish (downgraded to QoS1) TLS Session stickiness Retained messages with pluggable storage backends Last Will and Testament (LWT)

What is Erlang ? Why is it required for RabbitMQ ? Erlang is a general-purpose, concurrent, functional programming language, as well as a garbage-collected runtime system. The RabbitMQ server is written in the Erlang programming language and is built on the Open Telecom Platform framework for clustering and failover. Since RabbitMQ is built on top of Erlang, we will first need to install Erlang beforing installing RabbitMQ . Does RabbitMQ have any concept of message priority? RabbitMQ does have concept of priority-We can define the queue's priority range at the time the queue is created Messages where priority is not set get a priority of 0 Messages with a numeric priority higher than the maximum set on the queue get the highest priority the queue supports

Is RabbitMQ persistent? Having a queue durable is not same as making persistent messages. Messages can be distributed either with making mode to persistent or transient. When you post your message, you need to set the delivery mode to persistent if you want it to remain in your long-lasting queue during restart. Is RabbitMQ uses database? RabbitMQ intentionally does not store messages in a database. RabbitMQ writes messages to disk in below two 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. Does RabbitMQ is PUSH or PULL? RabbitMQ uses a PUSH template and prevents exhausting consumers through the prefetch configured limit. PULL is used by Kafka, where consumers request for messages from a particular offset batches. What is Dead Letter Exchange in Rabbitmq ? If there is no appropriate queue for the message, the message will be dropped quietly. RabbitMQ offers an AMQP extension known as the “Dead Letter Exchange”. The dead letter exchange provides features for collecting non-deliverable messages.

What is routing key in RabbitMQ? The routing key is a message attribute. The routing algorithm behind a direct exchange is simple – a message goes to the queues whose binding key exactly matches the routing key of the message. What are the different types of exchange types in RabbitMQ? RabbitMQ has following types of Exchanges- Direct helps in transfering the messages to the queues on the basis of message routing key. Fanout helps in sending messages to all the queues that are linked with it. Topic helps in exhanging matches between the routing key and the binding routing pattern. Headers helps in exchanging the routing attributes of the message headers.

How to delete all queues in RabbitMQ ? rabbitmqctl stop_app rabbitmqctl reset rabbitmqctl start_app What is a Server in Rabbitmq ? RabbitMQ Servers are robust and scalable implementation of AMQP broker, it helps in displaying a banner messages and reports on the progress in the startup sequence with the message Broker Running, that indicates the RabbitMQ broker has been started successfully.

What ports does RabbitMQ use? RabbitMQ Management console: PORT 15672 for RabbitMQ version 3.x PORT 55672 for RabbitMQ pre 3.x SERVER_ERL_ARGS=”+K true +A30 +P 1048576 \ -kernel inet_default_connect_options [{ nodelay,true }] \ -kernel inet_dist_listen_min 35197 \ -kernel inet_dist_listen_max 35197″

What is Messaging? Messaging is a communication mechanism used for system interactions. In software development messaging enables distributed communication that is loosely coupled. A messaging client can send messages to, and receive messages from, any other client.  What is Advanced Message Queuing Protocol (AMQP) ? The Advanced Message Queuing Protocol (AMQP) is an open standard application layer protocol for message-oriented middleware. AMQP 0-9-1 is a binary messaging protocol and semantic framework for microservices and enterprise messaging.

How to restart RabbitMQ service? We can restart it like any other service: sudo service rabbitmq -server restart We get a specific control interface as well: sudo rabbitmqctl “report” sudo rabbitmqctl “reset” What is the routing key in RabbitMQ? The message structure in the RabbitMQ is divided into two parts. They are the payload and routing key. The routing key is used to describe the payload passed by the system and the messaging system itself to determine who will be the receiver of the payload. The routing key also enables you to bind queues to exchanges to deliver the message to the queue based on the four types of exchanges.

MQ What are the disadvantages? Reduced system availability , Dependence on the outside You need to consider MQ Lost message , The problem of repeated consumption It takes effort to ensure the order of messages , Uniformity. What is Fanout Exchange ? Fanout exchange routes the messages to all queues which are bound to it. Say if there are 5 queues bound to Fanout Exchange then when message comes to Fanout Exchange it will go to all 5 queues. It is kind of publish-subscribe. What is binding ? It is link OR connection between exchange and queue. For exchange to route the message to particular queue that queue should be bound to exchange with routing key or headers.

THANK YOU Like the Video and Subscribe the Channel