Complete the code to declare a RabbitMQ queue named 'task_queue'.
channel.queue_declare(queue='[1]')
The queue name must be 'task_queue' to declare the correct queue.
Complete the code to publish a message to a Kafka topic named 'logs'.
producer.send('[1]', value=b'Hello Kafka')
Kafka uses topics to organize messages. The topic name here is 'logs'.
Fix the error in the RabbitMQ consumer code to acknowledge messages manually.
channel.basic_consume(queue='task_queue', on_message_callback=callback, auto_ack=[1])
Setting auto_ack to False means the consumer must manually acknowledge messages.
Fill both blanks to create a Kafka consumer that subscribes to 'metrics' and starts polling.
consumer = KafkaConsumer('[1]') message = consumer.[2]()
The consumer subscribes to the 'metrics' topic and polls messages using the poll() method.
Fill all three blanks to create a RabbitMQ message publisher with exchange type 'direct' and routing key 'info'.
channel.exchange_declare(exchange='[1]', exchange_type='[2]') channel.basic_publish(exchange='[1]', routing_key='[3]', body='Hello World')
The exchange is named 'logs' with type 'direct'. The routing key 'info' directs the message.