Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ jobs:
^\.assets$
^\.git$
^\.vscode$
^\asyncapi.sse.kafka.proxy$

testing:
strategy:
Expand Down
16 changes: 7 additions & 9 deletions examples/asyncapi.sse.kafka.proxy/.github/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ EXIT=0
PORT="7114"
KAFKA_BOOTSTRAP_SERVER="kafka.examples.dev:29092"
INPUT='{"id": 1,"name":"Hello World!"}'
EXPECTED='data:{ "id": 1, "name": "Hello World!"}'
EXPECTED='data:{"id": 1,"name":"Hello World!"}'
echo \# Testing asyncapi.sse.kafka.proxy/
echo PORT="$PORT"
echo KAFKA_BOOTSTRAP_SERVER="$KAFKA_BOOTSTRAP_SERVER"
Expand All @@ -16,20 +16,23 @@ echo EXPECTED="$EXPECTED"
echo

# WHEN

sleep 5

# send request to zilla
timeout 3s curl -N --http2 -H "Accept:text/event-stream" "http://localhost:$PORT/events" | tee .testoutput &

# push response to kafka with kafkacat
echo "$INPUT" |
docker compose -p zilla-http-kafka-sync exec -T kafkacat \
docker compose -p zilla-asyncapi-sse-kafka-proxy exec -T kafkacat \
kafkacat -P \
-b $KAFKA_BOOTSTRAP_SERVER \
-t events \
-k "1"

# fetch the output of zilla request; try 5 times
for i in $(seq 0 2); do
sleep $i
for i in $(seq 0 5); do
sleep 5
OUTPUT=$(cat .testoutput | grep "^data:")
if [ -n "$OUTPUT" ]; then
break
Expand All @@ -48,9 +51,4 @@ else
EXIT=1
fi

# TODO remove once fixed
echo '❌ curl: (52) Empty reply from server. Tested on main. and does not work with described instructions'
echo 'Refer: https://github.com/aklivity/zilla/issues/1417'
EXIT=1

exit $EXIT
2 changes: 0 additions & 2 deletions examples/asyncapi.sse.kafka.proxy/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ services:
ZILLA_INCUBATOR_ENABLED: "true"
volumes:
- ./etc:/etc/zilla
- ./sse-asyncapi.yaml:/etc/zilla/specs/sse-asyncapi.yaml
- ./kafka-asyncapi.yaml:/etc/zilla/specs/kafka-asyncapi.yaml
command: start -v -e

kafka:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ operations:
traits:
- $ref: "#/components/operationTraits/kafka"
messages:
- $ref: "#/channels/eventstore/messages/event"
- $ref: "#/channels/events/messages/event"
components:
messages:
event:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ info:
servers:
plain_sse:
host: localhost:7114
protocol: sse
protocol: http
defaultContentType: application/json

channels:
Expand All @@ -22,6 +22,9 @@ operations:
action: receive
channel:
$ref: "#/channels/events"
bindings:
x-zilla-sse:
method: "GET"

components:
schemas:
Expand Down
Loading