Complete the code to declare a queue named 'task_queue' in RabbitMQ.
channel.queue_declare(queue='[1]')
The queue name must be 'task_queue' to match the producer and consumer communication.
Complete the code to publish a message 'Hello World!' to the 'task_queue'.
channel.basic_publish(exchange='', routing_key='[1]', body='Hello World!')
The routing_key must be the queue name 'task_queue' to send the message to the correct queue.
Fix the error in the consumer code to receive messages from 'task_queue'.
channel.basic_consume(queue='[1]', on_message_callback=callback, auto_ack=True)
The consumer must listen to the queue named 'task_queue' to receive messages sent by the producer.
Fill both blanks to create a basic producer-consumer pattern: declare queue and publish message.
channel.queue_declare(queue='[1]') channel.basic_publish(exchange='', routing_key='[2]', body='Task message')
Both the queue declaration and the routing_key must use the same queue name 'task_queue' to connect producer and consumer.
Fill all three blanks to complete the consumer setup: declare queue, consume messages, and start consuming.
channel.queue_declare(queue='[1]') channel.basic_consume(queue='[2]', on_message_callback=callback, auto_ack=True) channel.[3]()
The queue must be declared and consumed with the same name 'task_queue'. The method to start consuming messages is 'start_consuming()'.