Last active
January 23, 2023 07:20
-
-
Save merlin-quix/6850c4519902b76da23bb9f4047b5ba3 to your computer and use it in GitHub Desktop.
Step 1 in the procedure "Creating a Kafka Producer to send data" from this article: https://www.quix.io/blog/send-timeseries-data-to-kafka-python/
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 packages | |
import pandas as pd | |
import json | |
import datetime as dt | |
from time import sleep | |
from kafka import KafkaProducer | |
# Initialize Kafka Producer Client | |
producer = KafkaProducer(bootstrap_servers=['localhost:9092']) | |
print(f'Initialized Kafka producer at {dt.datetime.utcnow()}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment