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:
@ -36,7 +36,7 @@ producer = KafkaProducer(bootstrap_servers=[opts.kafka_broker])
|
|||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
buf = sys.stdin.read(128)
|
buf = sys.stdin.readline()
|
||||||
|
|
||||||
if len(buf) == 0:
|
if len(buf) == 0:
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user