Created
April 26, 2018 07:58
-
-
Save owahab/9f081ec7938f51427cf84ba2aa9628f4 to your computer and use it in GitHub Desktop.
Send dummy messages to a Kafka topic using Kafkacat
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
#!/usr/bin/env bash | |
set -e | |
echo -n "Publishing dummy messages: " | |
while true; do | |
echo -n "." | |
date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
message="{\"id\": \"$(uuidgen)\", \"created_at\": \"$date\", \"some_key\": \"some value\"}" | |
echo $message | kafkacat -P -b 0.0.0.0:9092 -t my_dummy_queue | |
sleep 0.8 | |
done | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment