0
0
RabbitMQdevops~10 mins

Why tuning maximizes throughput in RabbitMQ - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the prefetch count for a RabbitMQ consumer.

RabbitMQ
channel.basic_qos(prefetch_count=[1])
Drag options to blanks, or click blank then click option'
A10
B1
C0
D-1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 (unlimited prefetch) or negative values which do not ensure processing one message at a time.
2fill in blank
medium

Complete the code to declare a durable queue in RabbitMQ.

RabbitMQ
channel.queue_declare(queue='task_queue', durable=[1])
Drag options to blanks, or click blank then click option'
AFalse
BNone
CTrue
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using False or None which creates non-durable queues.
3fill in blank
hard

Fix the error in the code to acknowledge a message after processing.

RabbitMQ
channel.basic_ack(delivery_tag=[1])
Drag options to blanks, or click blank then click option'
Amethod.delivery_tag
Bdelivery_tag
Ctag
Dmessage_tag
Attempts:
3 left
💡 Hint
Common Mistakes
Using undefined variables like delivery_tag or tag directly.
4fill in blank
hard

Fill both blanks to create a message consumer with manual acknowledgments and prefetch count set.

RabbitMQ
channel.basic_qos(prefetch_count=[1])
channel.basic_consume(queue='task_queue', on_message_callback=callback, auto_ack=[2])
Drag options to blanks, or click blank then click option'
A1
BTrue
CFalse
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using auto_ack=True disables manual acknowledgments.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that filters messages longer than 5 characters and converts keys to uppercase.

RabbitMQ
filtered = { [1]: [2] for [3], [2] in messages.items() if len([2]) > 5 }
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
Ck
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect variable names or missing the length condition.