Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Confluent CCDAK Exam - Topic 5 Question 98 Discussion

while (true) {ConsumerRecords records = consumer.poll(100);try {consumer.commitSync();} catch (CommitFailedException e) {log.error("commit failed", e)}for (ConsumerRecord 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());}}What kind of delivery guarantee this consumer offers?
C) At-most-once
A) Exactly-once
B) At-least-once

Confluent CCDAK Exam - Topic 5 Question 98 Discussion

Actual exam question for Confluent's CCDAK exam
Question #: 98
Topic #: 5
[All CCDAK Questions]

while (true) {

ConsumerRecords records = consumer.poll(100);

try {

consumer.commitSync();

} catch (CommitFailedException e) {

log.error("commit failed", e)

}

for (ConsumerRecord 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());

}

}

What kind of delivery guarantee this consumer offers?

Show Suggested Answer Hide Answer
Suggested Answer: C

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


Contribute your Thoughts:

0/2000 characters

Currently there are no comments in this discussion, be the first to comment!


Save Cancel