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:
parent
81b9d51aab
commit
78545b2c5c
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user