Skip to content

Instantly share code, notes, and snippets.

@olooney
Created May 17, 2018 15:20
Show Gist options
  • Save olooney/0d6837bc532df76c6d25362f663bfbba to your computer and use it in GitHub Desktop.
Save olooney/0d6837bc532df76c6d25362f663bfbba to your computer and use it in GitHub Desktop.
import kafka
p = kafka.KafkaProducer(bootstrap_servers='kafka:9092')
c = kafka.KafkaConsumer(bootstrap_servers='kafka:9092', auto_offset_reset='earliest')
p.send('oran', b'cool')
c.subscribe('oran')
p.send('oran', b'neat')
v1 = next(c)
v2 = next(c)
print(v1)
print(v2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment