Skip to content

Commit

Permalink
try multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
vordimous committed Oct 22, 2024
1 parent c054335 commit 8545458
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion http.kafka.sync/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ timeout 60s curl \
-d "{\"greeting\":\"$GREETING\"}" | tee .testoutput &

# fetch correlation id from kafka with kcat
CORRELATION_ID=$(docker compose -p zilla-http-kafka-sync exec -T kcat kafkacat -C -c 1 -o-1 -b $KAFKA_BOOTSTRAP_SERVER -t items-requests -J -u | jq -r '.headers | index("zilla:correlation-id") as $index | .[$index + 1]')
for i in $(seq 1 10); do
sleep $i
CORRELATION_ID=$(docker compose -p zilla-http-kafka-sync exec -T kcat kafkacat -C -c 1 -o-1 -b $KAFKA_BOOTSTRAP_SERVER -t items-requests -J -u | jq -r '.headers | index("zilla:correlation-id") as $index | .[$index + 1]')
if [ -n "$CORRELATION_ID" ]; then
break
fi
done
echo CORRELATION_ID="$CORRELATION_ID"
if [ -z "$CORRELATION_ID" ]; then
echo
Expand Down

0 comments on commit 8545458

Please sign in to comment.