Complete the code to declare a dead letter exchange named 'dlx'.
channel.exchange_declare(exchange='[1]', exchange_type='direct')
The dead letter exchange is commonly named 'dlx' to handle dead letters.
Complete the code to declare a queue with dead letter exchange set to 'dlx'.
channel.queue_declare(queue='task_queue', arguments={'[1]': 'dlx'})
The argument 'x-dead-letter-exchange' sets the dead letter exchange for the queue.
Fix the error in the code to bind the dead letter queue to the dead letter exchange with routing key 'error'.
channel.queue_bind(queue='dead_letter_queue', exchange='dlx', routing_key='[1]')
The routing key 'error' is used to route dead letters to the dead letter queue.
Fill both blanks to declare a queue with dead letter exchange 'dlx' and dead letter routing key 'error'.
channel.queue_declare(queue='task_queue', arguments={'[1]': 'dlx', '[2]': 'error'})
The keys 'x-dead-letter-exchange' and 'x-dead-letter-routing-key' configure dead letter routing.
Fill all three blanks to create a dead letter queue named 'dead_letter_queue', bind it to exchange 'dlx' with routing key 'error'.
channel.queue_declare(queue='[1]') channel.queue_bind(queue='dead_letter_queue', exchange='[2]', routing_key='[3]')
The queue name is 'dead_letter_queue', exchange is 'dlx', and routing key is 'error' for dead letter handling.