Last active
August 21, 2020 09:34
-
-
Save kzltp/144d94ab2c395b752c7dd54d7051f638 to your computer and use it in GitHub Desktop.
Kafka Random Send Message Script
This file contains hidden or 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
| #!/bin/sh | |
| WORDFILE="/usr/share/dict/words" | |
| messcounst=0 | |
| while true | |
| do | |
| date=$(date +"%Y-%m-%d_%H-%M-%S") | |
| messcounst=`expr $messcounst + 1` | |
| word=$(shuf -n1 /usr/share/dict/words) | |
| echo "$date Arif'in mesaji random word P1 - $messcounst : $word" | /opt/kafka/bin/kafka-console-producer.sh --broker-list [KAFKAHOST]:9092 --topic ArifTestTopic > /dev/null | |
| sleep 15 | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment