group.id set to my-static-groupgroup.instance.id set to consumer-1 to enable static membershipmy-topicgroup.id set to my-static-groupgroup.instance.id set to consumer-1 to enable static membershipmy-topicconsumer_config with these exact entries: 'bootstrap.servers': 'localhost:9092' and 'group.id': 'my-static-group'.Use a Python dictionary with keys 'bootstrap.servers' and 'group.id'.
'group.instance.id': 'consumer-1' to the existing consumer_config dictionary.Add the key 'group.instance.id' with the value 'consumer-1' inside the dictionary.
consumer_config and subscribe it to the topic 'my-topic'. Use variable name consumer for the consumer instance.Use consumer.subscribe(['my-topic']) to subscribe to the topic.
consumer.assignment() and printing the result.Use print(consumer.assignment()) to show the assigned partitions. It may print an empty list if no partitions are assigned yet.
What is the main purpose of using group.instance.id in Kafka consumer groups?
group.instance.idgroup.instance.id with partition countWhich of the following is the correct way to set group.instance.id in a Kafka consumer configuration?
Properties props = new Properties();
props.put("bootstrap.servers", "localhost:9092");
// What is the correct line to set static membership?group.instance.id.props.put("group.instance.id", "consumer-1") correctly sets the static ID.Consider this Kafka consumer group with static membership enabled using group.instance.id. If a consumer with group.instance.id = "consumer-1" disconnects briefly and reconnects, what happens?
Given this Kafka consumer config snippet, identify the error preventing static group membership:
props.put("group.id", "my-group");
props.put("group.instance.id", "consumer-1");
props.put("session.timeout.ms", "10000");
// Missing property?group.protocol.type to be set to consumer explicitly in some Kafka versions.group.protocol.type, which can prevent static membership from working properly.group.protocol.type set to consumer -> Option AYou have a Kafka consumer group with 3 consumers using static membership via group.instance.id. One consumer crashes and restarts quickly with the same group.instance.id. What is the expected behavior and why is static membership important here?
Pass the test and this pattern moves unknown