Read complete lines with Kafka producer

There's no need to process the JSON twice as the Kafka producer is
expected to be used with the Python CDC client which already splits the
JSON with newlines.
This commit is contained in:
Markus Mäkelä 2017-01-27 13:06:25 +02:00
parent 81b9d51aab
commit 78545b2c5c

View File

@ -36,7 +36,7 @@ producer = KafkaProducer(bootstrap_servers=[opts.kafka_broker])
while True:
try:
buf = sys.stdin.read(128)
buf = sys.stdin.readline()
if len(buf) == 0:
break