21.) How can a producer flush pending records to Kafka?
A) Call commit()
B) Call sync()
C) Call flush()
D) Call send() again
22.) Which serializer is used for sending String data?
A) JsonSerializer
B) ByteSerializer
C) ObjectSerializer
D) StringSerializer
23.) What is the main benefit of using callback with send()?
A) It retries automatically
B) It gives sync behavior
C) It notifies when the message is acknowledged
D) It disables batching
24.) Which property sets the maximum size of a Kafka message?
A) message.size.max
B) max.message.bytes
C) message.max.bytes
D) max.request.size
25.) Which config in KafkaConsumer limits the number of records per poll()?
A) max.poll.records
B) poll.size.max
C) batch.size
D) poll.limit
26.) What happens when a KafkaProducer is not closed?
A) Messages are lost
B) It auto-closes
C) JVM throws an error
D) Resources like threads may leak
27.) What is the typical polling interval for consumers?
A) Every second
B) Controlled by poll() timing
C) Every 5 minutes
D) Kafka controls it internally
28.) What is the role of Kafka callback interface?
A) Serializing records
B) Modifying partitions
C) Handling errors or success in send()
D) Logging consumer offsets
29.) What class provides metadata for sent records in the producer?
A) RecordMetadata
B) RecordMetadata
C) SendMetadata
D) MessageMeta
30.) Which Kafka client version introduced KafkaAdminClient for Java-based admin operations?
A) 0.8
B) 0.10
C) 1.0
D) 2.0
Related