Complete the code to specify the message broker type in the configuration.
config = {"broker": "[1]"}The configuration must specify the message broker type. Kafka is a popular message broker used in microservices.
Complete the code to create a durable queue in RabbitMQ.
channel.queue_declare(queue='task_queue', durable=[1])
Setting durable=True ensures the queue survives broker restarts, which is important for reliable message delivery.
Fix the error in the Kafka consumer group configuration.
consumer = KafkaConsumer('my_topic', group_id='[1]')
The group_id must be a non-empty string to identify the consumer group. 'my_group' is a valid group id.
Fill both blanks to configure a Kafka topic with 3 partitions and replication factor 2.
topic_config = {'partitions': [1], 'replication_factor': [2]Kafka topics are configured with the number of partitions and replication factor. Here, 3 partitions and replication factor 2 ensure scalability and fault tolerance.
Fill all three blanks to create a RabbitMQ exchange with type 'direct', durable true, and auto_delete false.
channel.exchange_declare(exchange='logs', exchange_type='[1]', durable=[2], auto_delete=[3])
The exchange type 'direct' routes messages with exact matching routing keys. Durable true keeps the exchange after broker restarts. Auto_delete false prevents automatic deletion when no queues are bound.