while (true) {
ConsumerRecords
try {
consumer.commitSync();
} catch (CommitFailedException e) {
log.error("commit failed", e)
}
for (ConsumerRecord
{
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?
Here offset is committed before processing the message. If consumer crashes before processing the message, message will be lost when it comes back up.
Currently there are no comments in this discussion, be the first to comment!