Skip to content

Instantly share code, notes, and snippets.

@emmettbutler
Created June 21, 2016 14:06
Show Gist options
  • Save emmettbutler/172df53576522f52ebd1e3fff30748f4 to your computer and use it in GitHub Desktop.
Save emmettbutler/172df53576522f52ebd1e3fff30748f4 to your computer and use it in GitHub Desktop.
try:
msg = self.consumer.consume()
except ConsumerStoppedException:
self.consumer.stop()
log.info('Restarting stopped pykafka consumer')
self.consumer.start()
msg = self.consumer.consume()
if not msg or not msg.value:
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment