Bird
0
0

Consider the following Python code using pika:

medium📝 Command Output Q4 of 15
RabbitMQ - Performance Tuning
Consider the following Python code using pika:
connection = pika.BlockingConnection()
channel_a = connection.channel()
channel_b = connection.channel()
print(channel_a.is_open, channel_b.is_open)
What will be printed?
AFalse True
BFalse False
CTrue False
DTrue True
Step-by-Step Solution
Solution:
  1. Step 1: Understand channel creation

    Each call to connection.channel() creates a new open channel.
  2. Step 2: Check channel state

    Immediately after creation, is_open property is True for both channels.
  3. Final Answer:

    True True -> Option D
  4. Quick Check:

    Channels are open right after creation [OK]
Quick Trick: New channels are open by default after creation [OK]
Common Mistakes:
MISTAKES
  • Assuming channels are closed by default
  • Confusing connection state with channel state
  • Thinking channels share state and one affects the other

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More RabbitMQ Quizzes