0
0
RabbitMQdevops~10 mins

Dead letter exchanges and queues in RabbitMQ - Interactive Code Practice

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

Complete the code to declare a dead letter exchange named 'dlx'.

RabbitMQ
channel.exchange_declare(exchange='[1]', exchange_type='direct')
Drag options to blanks, or click blank then click option'
Adlx
Bmain_exchange
Clogs
Dbackup_exchange
Attempts:
3 left
💡 Hint
Common Mistakes
Using the main exchange name instead of the dead letter exchange name.
Choosing a generic exchange name unrelated to dead letters.
2fill in blank
medium

Complete the code to declare a queue with dead letter exchange set to 'dlx'.

RabbitMQ
channel.queue_declare(queue='task_queue', arguments={'[1]': 'dlx'})
Drag options to blanks, or click blank then click option'
Ax-dead-letter-exchange
Bx-priority
Cx-message-ttl
Dx-max-length
Attempts:
3 left
💡 Hint
Common Mistakes
Using TTL or max length arguments instead of dead letter exchange.
Confusing priority with dead letter settings.
3fill in blank
hard

Fix the error in the code to bind the dead letter queue to the dead letter exchange with routing key 'error'.

RabbitMQ
channel.queue_bind(queue='dead_letter_queue', exchange='dlx', routing_key='[1]')
Drag options to blanks, or click blank then click option'
Adlx
Berror
Ctask_queue
Dmain
Attempts:
3 left
💡 Hint
Common Mistakes
Using the exchange name as routing key.
Using the original queue name instead of the dead letter routing key.
4fill in blank
hard

Fill both blanks to declare a queue with dead letter exchange 'dlx' and dead letter routing key 'error'.

RabbitMQ
channel.queue_declare(queue='task_queue', arguments={'[1]': 'dlx', '[2]': 'error'})
Drag options to blanks, or click blank then click option'
Ax-dead-letter-exchange
Bx-message-ttl
Cx-dead-letter-routing-key
Dx-max-length
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing TTL or max length keys with dead letter keys.
Using incorrect keys that do not configure dead letter routing.
5fill in blank
hard

Fill all three blanks to create a dead letter queue named 'dead_letter_queue', bind it to exchange 'dlx' with routing key 'error'.

RabbitMQ
channel.queue_declare(queue='[1]')
channel.queue_bind(queue='dead_letter_queue', exchange='[2]', routing_key='[3]')
Drag options to blanks, or click blank then click option'
Adead_letter_queue
Bdlx
Cerror
Dtask_queue
Attempts:
3 left
💡 Hint
Common Mistakes
Using the original queue name instead of dead letter queue name.
Mixing up exchange and queue names.
Using wrong routing keys that do not match dead letter setup.