Skip to content

Instantly share code, notes, and snippets.

@schroedermatt
Created April 4, 2022 20:36
Show Gist options
  • Select an option

  • Save schroedermatt/f8c034fb9b4d6b55f09d6e5b1deb65b7 to your computer and use it in GitHub Desktop.

Select an option

Save schroedermatt/f8c034fb9b4d6b55f09d6e5b1deb65b7 to your computer and use it in GitHub Desktop.
// get all assigned partitions for the consumer
Set<TopicPartition> assignedPartitions = consumer.assignment();
// pause all assigned partitions
Set<TopicPartition> pausedPartitions = consumer.pause(assignedPartitions);
// resume all paused partitions
consumer.resume(consumer.paused());
// you could also resume the consumer.assignment() since everything is paused
consumer.resume(consumer.assignment());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment