kafka-pipe - use a random key for messages
This commit is contained in:
parent
4329651c86
commit
8b11670a69
1 changed files with 5 additions and 2 deletions
|
|
@ -10,12 +10,15 @@ endProcess() {
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# some random ID, to use as a message key
|
||||||
|
INSTANCE_ID=$(cat /proc/sys/kernel/random/uuid)
|
||||||
|
|
||||||
while :; do
|
while :; do
|
||||||
docker logs --tail 0 -f "$FACTORIO_SERVER_CONTAINER_NAME" |
|
docker logs --tail 0 -f "$FACTORIO_SERVER_CONTAINER_NAME" |
|
||||||
sed -n -e 's/^FactorioEvent: //p' |
|
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"
|
echo "Error - retrying in 10 seconds"
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue