...
Code Block | ||
---|---|---|
| ||
try{ for(...){ //Processing batches of records... } //Commit when we know we're done, after the batch is processed myConsumer.commitSync(); }catch(CommitFailedException){ log.error("..."); } |
commitSync() is synchronous = blocks until receives response from cluster.