Skip to content

Instantly share code, notes, and snippets.

@1ambda
Created December 29, 2021 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1ambda/d3e9897bd4fcc8dbdd5e4ba4a66f5c64 to your computer and use it in GitHub Desktop.
Save 1ambda/d3e9897bd4fcc8dbdd5e4ba4a66f5c64 to your computer and use it in GitHub Desktop.
ConsumerRecords records = consumer.poll(Long.MAX_VALUE);
producer.beginTransaction();
for (ConsumerRecord record : records)
producer.send(producerRecord(“outputTopic”, record));
producer.sendOffsetsToTransaction(currentOffsets(consumer), group);
producer.commitTransaction();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment