Complete the code to set up a Kafka consumer in active-passive mode.
consumer = KafkaConsumer('my_topic', group_id=[1], bootstrap_servers=['localhost:9092'])
In active-passive mode, consumers share a group ID to ensure only one is active at a time.
Complete the code to configure Kafka producers for active-active replication.
producer = KafkaProducer(acks=[1], bootstrap_servers=['localhost:9092'])
Setting acks='all' ensures all replicas acknowledge the message, supporting active-active consistency.
Fix the error in the consumer group configuration for active-active mode.
consumer = KafkaConsumer('topic', group_id=[1], bootstrap_servers=['localhost:9092'])
In active-active mode, consumers often have no group ID to allow independent consumption.
Fill both blanks to create a Kafka topic with replication and partition count for active-active setup.
admin_client.create_topics([NewTopic(name='my_topic', num_partitions=[1], replication_factor=[2])])
Active-active requires multiple partitions (3) and replication factor (2) for fault tolerance and parallelism.
Fill all three blanks to configure a Kafka consumer with manual commit in active-passive mode.
consumer = KafkaConsumer('topic', group_id=[1], enable_auto_commit=[2], auto_offset_reset=[3], bootstrap_servers=['localhost:9092'])
Manual commit requires enable_auto_commit=False. Active-passive uses a shared group ID and starts from earliest offset.