Top 50 RabbitMQ Questions & Answers

In this post we will look at RabbitMQ Interview questions and answers. Below are some Examples provided with explanations.

Question#1 Which of the following is the component that routes messages to queues?

i) Channel

ii) Binding

iii) Exchange

iv) Connection

Answer# Exchange

Question#2 RabbitMQ server is written using?

i) C#

ii) Erlang

iii) Java

iv) JavaScript

Answer# Erlang

Question#3 Which of the following exchange is pre-declared if no exchange is declared?

i) Direct Exchange

ii) Topic Exchange

iii) Default Exchange

iv) Header Exchange

Answer# Default Exchange

Question#4 Which of the following is the client library for Node.js to integrate with RabbitMQ?

i) Ampqlib

ii) Bunny

iii) Pika

iv) Objective-C

Answer# Ampqlib

Question#5 RabbitMQ server is an open source implementation of?

i) AMQP protocol

ii) DDS protocol

iii) MQTT protocol

iv) CoAP protocol

Answer# AMQP protocol

Question#6 Using ConnectionFactory Connection is created using built in method

i) createConnection()

ii) newConnection()

iii) Connection()

iv) buildConnection()

Answer# newConnection()

Question#7 Which of the following exchange routes messages to queues by ignoring the routing key?

i) Topic Exchange

ii) Fanout Exchange

iii) HeaderExchange

iv) Direct Exchange

Answer# Fanout Exchange

Question#8 Which of the following is the buffer that stores messages sent by the producer?

i) Channel

ii) Connection

iii) Queue

iv) Exchange

Answer# Queue

Question#9 Which of the following is the virtual connection inside a connection?

i) Queue

ii) Exchange

iii) Binding

iv) Channel

Answer# Channel

Question#10 What is the default port of the RabbitMQ management interface?

i) 15762

ii) 8000

iii) 15672

iv) 8090

Answer# 15672

Question#11 Which of the following built-in channel method declares a queue?

i) queueDeclare()

ii) createQueue()

iii) newQueue()

iv) declareQueue()

Answer# queueDeclare()

Question#12 Using Connection channel can be created using builtin method

i) createChannel()

ii) newChannel()

iii) Channel()

iv) buildChannel()

Answer# createChannel()

Question#13 Queues that are deleted after performing a task are called?

i) Exclusive Queues

ii) WorkQueues

iii) Auto Delete Queues

iv) TemporaryQueues

Answer# TemporaryQueues

Question#14 Which property of a channel is used to display acknowledge details?

i) ack

ii) Prefetch

iii) unacked

iv) confirm

Answer# ack

Question#15 Which of the following parameter is provided to the nextDelivery() method and specifies the time to wait for the next delivery message?

i) Timeout

ii) Break

iii) Wait

iv) Sleep

Answer# Timeout

Question#16 Using Channel message can be consumed using builtin method

i) recieveMessage()

ii) newConsume()

iii) basicConsume()

iv) Consume()

Answer# basicConsume()

Question#17 Using Channel message can be published using builtin method

i) sendMessage()

ii) basicPublish()

iii) newPublish()

iv) publish()

Answer# basicPublish()

Question#18 Pika is the RabbitMQ client library for?

i) Java

ii) Python

iii) Node.js

iv) Spring

Answer# Python

Question#19 Which of the following tag allows a user to access only the management plugin?

i) Policymaker

ii) Management

iii) Monitoring

iv) Administrator

Answer# Management

Question#20 Expiry time for a queue is set by assigning which property?

i) TTL

ii) Timeout

iii) Auto expire

iv) Auto delete

Answer# Auto expire

Question#21 Which of the following command creates a user Jim and password root?

i) rabbitmqctl add_user jim root

ii) rabbitmqctl add_user root jim

iii) rabbitmqctl add jim root

iv) rabbitmqctl user jim root

Answer# rabbitmqctl add_user root jim

Question#22 The default SASL method supported by RabbitMQ is?

i) AMQPLAIN

ii) RABBIT-CR-DEMO

iii) PLAIN

iv) EXTERNAL

Answer# PLAIN

Question#23 In spring AMPQ, which of the following class enables to publish messages?

i) RabbitTemplate

ii) RabbitAdmin

iii) AmpqTemplate

iv) AmpqAdmin

Answer# RabbitTemplate

Question#24 Which of the following property assigned to a queue specifies the queue survival time?

i) Transient

ii) Max-Time

iii) Durable

iv) TTL

Answer# TTL

Question#25 Which of the following is the permission required to create a resource?

i) Read

ii) Configure

iii) Create

iv) Write

Answer# Create

Question#26 By default, nodes in a cluster are created as DISK nodes.

i) True

ii) False

Answer# True

Question#27 Using Channel binding can be done using builtin method

i) binding()

ii) coupling()

iii) bindQueue()

iv) queueBind()

Answer# binding()

Question#28 Which of the following exchange has the routing key as a list of words?

i) Header Exchange

ii) DirectExchange

iii) Fanout Exchange

iv) Topic Exchange

Answer# Topic Exchange

Question#29 Which of the following command deletes user Jim?

i) rabbitmqctl.bat delete_user Jim

ii) rabbitmqctl.bat remove Jim

iii) rabbitmqctl.bat delete Jim

iv) rabbitmqctl.bat remove_user Jim

Answer# rabbitmqctl.bat delete Jim

Question#30 Which of the following is the command to delete quiz Vhost?

i) rabbitmqctl.bat remove_vhost events

ii) rabbitmqctl.bat delete_vhost quiz

iii) rabbitmqctl.bat remove_vhost quiz

iv) rabbitmqctl.bat delete events

Answer# rabbitmqctl.bat delete_vhost quiz

Question#31 In a remote procedure call, what is the unique identifier assigned to every request message?

i) CorelationId

ii) Binding

iii) Routing key

iv) UniqueId

Answer# CorelationId

What is RabbitMQ ?

RabbitMQ is an open source message broker software (sometimes called message-oriented middleware) that implements the Advanced Message Queuing Protocol (AMQP). The RabbitMQ server is written in the Erlang programming language and is built on the Open Telecom Platform framework for clustering and failover.

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. RabbitMQ is based on AMQP 0-9-1 Protocol. RabbitMQ supports –

  • AMQP 0-9-1
  • AMQP 1.0
  • MQTT
  • STOMP
  • HTTP

RabbitMQ Messaging Flow- Bindings are what connects the exchanges to queues.
RabbitMQ Message Flow

What is an exchange in RabbitMQ?

An exchange accepts messages from the producer application and routes them to message queues with help of header attributes, bindings, and routing keys. A binding is a “link” that you set up to bind a queue to an exchange.

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 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

How to install RabbitMQ?

Install RabbitMQ on Windows

How to integrate RabbitMQ with Spring Boot?

Spring Boot + RabbitMQ Example

What is Spring Cloud Stream? What is the need for it?

In previous examples we had implemented examples for integrating Spring Boot Applications with Messaging Systems like Apache Kafka and RabbitMQ. If you look at these examples these required a lot of configuration code which was Broker specific. For example in case of RabbitMQ integration with Spring Boot we had to write code to create AmqpTemplate Template and Bindings. So if tomorrow the Messaging System changes we will also need to make application code changes.
Spring Cloud helps solve this problem using Spring Cloud Stream. Using Spring Cloud Stream we can develop applications where we do not need to specify the implementation details of the messaging system we want to use. We just need to specify the required binding dependencies and Spring Cloud Stream will the integrate the messaging systems to Spring Boot Application.
Spring Cloud Stream Tutorial
Spring Cloud Stream Tutorial – Publish Message to RabbitMQ Simple Example
Spring Cloud Stream Tutorial – Consume Message from RabbitMQ Simple Example

What are the types of exchanges available in RabbitMQ?

There are 4 types of exchanges available in RabbitMQ.

  • Direct – Based on the routing key a message is sent to the binding queue having the same routing key. The routing key of exchange and the binding queue have to be an exact match.
    Direct Exchange type
  • Fanout – The message is routed to all the available bounded queues. The routing key if provided is completely ignored. So this is a kind of publishe-subscribe design pattern.
    Fanout Exchange type
  • Topic – Here again the routing key is made use of. But unlike in direct exchange type, here the routing key of the exchange and the bound queues should not necessarily be an exact match. Using regular expressions like wildcard we can send the exchange to multiple bound queues.
    Topic Exchange type
  • Headers – In this type of exchange the routing queue is selected based on the criteria specified in the headers instead of the routing key. This is similar to topic exchange type, but here we can specify complex criteria for selecting routing queues.
    Headers Exchange type

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

What is STOMP?

STOMP is a simple text-oriented messaging protocol used by our UI Client(browser) to connect to enterprise message brokers.
Clients can use the SEND or SUBSCRIBE commands to send or subscribe for messages along with a “destination” header that describes what the message is about and who should receive it.
It defines a protocol for clients and servers to communicate with messaging semantics. It does not define any implementation details, but rather addresses an easy-to-implement wire protocol for messaging integrations. The protocol is broadly similar to HTTP, and works over TCP using the following commands:

  • CONNECT
  • SEND
  • SUBSCRIBE
  • UNSUBSCRIBE
  • BEGIN
  • COMMIT
  • ABORT
  • ACK
  • NACK
  • DISCONNECT

Spring Boot Websocket Chat STOMP Architecture

How to implement Chat Application using Spring Boot + WebSocket + RabbitMQ?

Build a Chat Application using Spring Boot + WebSocket + RabbitMQ
Build a web chat using Spring Boot and WebSocket.

How to implement Retry and Error Handling for RabbitMQ?

Spring Boot + RabbitMQ Tutorial – Retry and Error Handling Example
In this tutorial we will be implementing a Spring Boot + RabbitMQ example to retry messages on exception and if exception still exists after maximum retries then put message in a dead letter queue where it can be analyzed and corrected later.

About Author


After years of Technical Work, I feel like an expert when it comes to Develop wordpress website. Check out How to Create a Wordpress Website in 5 Mins, and Earn Money Online Follow me on Facebook for all the latest updates.

Leave a Comment