cleanup and kafka producer
This commit is contained in:
@ -1 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
from kafka import KafkaProducer
|
||||
|
||||
|
||||
producer = KafkaProducer(bootstrap_servers='localhost:9092')
|
||||
|
||||
|
||||
try:
|
||||
n = 10
|
||||
string = "\"" + "a" * n + "\""
|
||||
binstring = string.encode('UTF-8')
|
||||
while True:
|
||||
producer.send('test', binstring)
|
||||
except Exception:
|
||||
producer.close()
|
||||
|
Reference in New Issue
Block a user