11.) Which method is used to subscribe to Kafka topics in the consumer?
A) register()
B) subscribe()
C) listen()
D) readFrom()
12.) What type of parameter does subscribe() accept?
A) A single topic name string
B) An array of strings
C) A list of strings
D) A map of topics
13.) What does the poll() method do in KafkaConsumer?
A) Sends messages to the topic
B) Requests topic metadata
C) Creates a consumer group
D) Fetches records from Kafka
14.) What object does poll() return?
A) ConsumerRecord
B) Map<String, String>
C) ConsumerRecords
D) String[]
15.) What must be done after consuming messages using manual offset management?
A) Call flush()
B) Call commitSync() or commitAsync()
C) Call close()
D) Nothing, Kafka handles it
16.) What does the auto.offset.reset property control?
A) How offsets are synced
B) What offset to use when no offset is found
C) Retry policy
D) Producer buffering strategy
17.) What happens if enable.auto.commit is set to false?
A) Consumer must commit offsets manually
B) Kafka auto-deletes the messages
C) Kafka assigns no partitions
D) Consumer can’t consume from topics
18.) What class encapsulates messages consumed from Kafka?
A) ConsumerRecord
B) KafkaMessage
C) MessageObject
D) KafkaMessageWrapper
19.) Which property is used to specify a consumer group ID?
A) kafka.group.name
B) consumer.group
C) group.id
D) consumer.group.name
20.) What happens when two consumers share the same group ID?
A) They will receive duplicate messages
B) Kafka will split partitions among them
C) Only one of them can consume
D) Messages will be lost
Related