0
0
RabbitMQdevops~10 mins

Why security protects message integrity 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 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'
ATrue
BFalse
CNone
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using durable=False causes messages to be lost on restart.
2fill in blank
medium

Complete the code to publish a persistent message to the queue.

RabbitMQ
channel.basic_publish(exchange='', routing_key='task_queue', body=message, properties=pika.BasicProperties(delivery_mode=[1]))
Drag options to blanks, or click blank then click option'
A1
B3
C2
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using delivery_mode=1 causes message loss on restart.
3fill in blank
hard

Fix the error in the code to enable publisher confirms for message integrity.

RabbitMQ
channel.[1]()
Drag options to blanks, or click blank then click option'
Aconfirm_select
Bconfirm_delivery
Cenable_confirm
Dset_confirm
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent methods like confirm_delivery or enable_confirm.
4fill in blank
hard

Fill both blanks to set up a secure connection with TLS and verify the server certificate.

RabbitMQ
parameters = pika.ConnectionParameters(host='rabbitmq.example.com', ssl_options=[1](ca_certs='ca.pem', cert_reqs=[2]))
Drag options to blanks, or click blank then click option'
Apika.SSLOptions
Bpika.SSLContext
Cssl.CERT_REQUIRED
Dssl.CERT_NONE
Attempts:
3 left
💡 Hint
Common Mistakes
Using ssl.CERT_NONE disables certificate verification, reducing security.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that filters messages with priority above 5 and marks them as urgent.

RabbitMQ
urgent_messages = [1]: {'priority': [2], 'urgent': [3] for [1], [2] in messages.items() if [2] > 5
Drag options to blanks, or click blank then click option'
Amsg_id
Bpriority
CTrue
DFalse
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing keys and values or using False instead of True for urgent.