kafka-pipe - use a random key for messages

This commit is contained in:
Adam 2021-10-25 23:22:23 +02:00
parent 4329651c86
commit 8b11670a69

View file

@ -10,12 +10,15 @@ endProcess() {
exit
}
# some random ID, to use as a message key
INSTANCE_ID=$(cat /proc/sys/kernel/random/uuid)
while :; do
docker logs --tail 0 -f "$FACTORIO_SERVER_CONTAINER_NAME" |
sed -n -e 's/^FactorioEvent: //p' |
kafkacat -P -T -b "$KAFKA_HOST" -t factorio-server-log
kafkacat -P -T -b "$KAFKA_HOST" -t factorio-server-log -k "$INSTANCE_ID"
echo "Error - retrying in 10 seconds"
sleep 10
done