0
0
RabbitMQdevops~5 mins

Connections and channels in RabbitMQ - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a connection in RabbitMQ?
A connection is a TCP connection between your application and the RabbitMQ broker. It is the main communication link over which data is sent.
Click to reveal answer
beginner
What is a channel in RabbitMQ?
A channel is a virtual connection inside a connection. It allows multiple independent conversations over a single TCP connection.
Click to reveal answer
intermediate
Why use channels instead of multiple connections?
Channels are lightweight and faster to create than connections. Using channels reduces resource use and improves performance by sharing one TCP connection.
Click to reveal answer
beginner
How do you create a channel in RabbitMQ using code?
You first create a connection, then call the method to open a channel on that connection. For example, in Python: <br>connection = pika.BlockingConnection(parameters)<br>channel = connection.channel()
Click to reveal answer
intermediate
What happens if a connection is closed in RabbitMQ?
All channels inside that connection are closed too. The application loses communication until a new connection is established.
Click to reveal answer
What is the main purpose of a channel in RabbitMQ?
ATo allow multiple conversations over one connection
BTo establish a TCP connection
CTo store messages permanently
DTo encrypt data
Which of these is true about RabbitMQ connections?
AThey are lightweight and fast to create
BThey are TCP connections between client and broker
CThey are virtual and exist inside channels
DThey automatically retry failed messages
What happens when a RabbitMQ connection closes?
AChannels inside it close too
BChannels stay open
CMessages are deleted
DNew connections are created automatically
Why should you prefer channels over multiple connections?
AChannels create new TCP connections
BChannels encrypt messages
CChannels use fewer resources and are faster
DChannels store messages permanently
How do you open a channel in RabbitMQ using code?
ACreate a new TCP connection
BClose the connection
CSend a message to the broker
DCall channel() on an existing connection
Explain the difference between a connection and a channel in RabbitMQ.
Think about how many conversations can happen over one wire.
You got /4 concepts.
    Describe why using channels is better than opening many connections in RabbitMQ.
    Consider resource use and speed.
    You got /4 concepts.