What kind of delivery guarantee this consumer offers?

What kind of delivery guarantee this consumer offers?

while (true) {

ConsumerRecords<String, String> records = consumer.poll(100);

try {

consumer.commitSync();

} catch (CommitFailedException e) { log.error("commit failed", e)

}

for (ConsumerRecord<String, String> record records)

{

System.out.printf("topic = %s, partition = %s, offset = %d, customer = %s, country = %s

",

record.topic(), record.partition(), record.offset(), record.key(), record.value());

}

}
A . Exactly-once
B . At-least-once
C . At-most-once

Answer: C

Explanation:

Here offset is committed before processing the message. If consumer crashes before processing the message, message will be lost when it comes back up.

Latest CCDAK Dumps Valid Version with 150 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments