Skip to content

Commit

Permalink
use the -T flag
Browse files Browse the repository at this point in the history
  • Loading branch information
vordimous committed Oct 22, 2024
1 parent 665a1ac commit 6dcceaa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions http.kafka.sync/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ echo

# WHEN
# send request to zilla
timeout 20s curl \
timeout 5s curl \
-X "PUT" http://localhost:$ZILLA_PORT/items/$ITEM_ID \
-H "Idempotency-Key: $ITEM_ID" \
-H "Content-Type: application/json" \
-d "{\"greeting\":\"$GREETING\"}" | tee .testoutput &

# fetch correlation id from kafka with kcat
CORRELATION_ID=$(docker compose -p zilla-http-kafka-sync exec kcat kafkacat -C -c 1 -b $KAFKA_BOOTSTRAP_SERVER -t items-requests -J -u | jq -r '.headers | index("zilla:correlation-id") as $index | .[$index + 1]')
CORRELATION_ID=$(docker compose -p zilla-http-kafka-sync exec -T kcat kafkacat -C -c 1 -b $KAFKA_BOOTSTRAP_SERVER -t items-requests -J -u | jq -r '.headers | index("zilla:correlation-id") as $index | .[$index + 1]')
echo CORRELATION_ID="$CORRELATION_ID"
if [ -z "$CORRELATION_ID" ]; then
echo
Expand All @@ -44,7 +44,7 @@ echo "{\"greeting\":\"$GREETING_DATE\"}" |
-H ":status=200" \
-H "zilla:correlation-id=$CORRELATION_ID"

sleep 40
sleep 10

# fetch the output of zilla request
cat .testoutput
Expand Down

0 comments on commit 6dcceaa

Please sign in to comment.