Created
April 4, 2022 20:36
-
-
Save schroedermatt/f8c034fb9b4d6b55f09d6e5b1deb65b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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