Last active
January 22, 2023 13:35
-
-
Save merlin-quix/6946c5d8bb104c29df184dfbcc6d20c1 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
for i in df.index: | |
# Create a message that includes a message ID and email text | |
data = {'MessageID': str(i), | |
'MessageBody': df['Message'][i]} | |
# Print the message so you can see what is being sent | |
print(f'Sending message: {data}') | |
# Send the data with the KafkaProducer client | |
producer.send(topic="emails", value=data) | |
print(f'Sent record to topic at time {dt.datetime.utcnow()}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment