Last active
January 22, 2023 16:51
-
-
Save merlin-quix/a3452acc4a22982fa749038176968a35 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from kafka import KafkaProducer | |
file = 'access.log' | |
producer_compression = KafkaProducer(bootstrap_servers=['localhost:9092'], | |
value_serializer=lambda x:json.dumps(x, default=str).encode('utf-8'), | |
key_serializer=lambda y:str(y).encode("utf-8"), | |
compression_type="gzip") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment