diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8bbd536797..94f280b373 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,7 +83,6 @@ jobs: ^\.assets$ ^\.git$ ^\.vscode$ - ^\asyncapi.sse.kafka.proxy$ testing: strategy: diff --git a/examples/asyncapi.sse.kafka.proxy/.github/test.sh b/examples/asyncapi.sse.kafka.proxy/.github/test.sh index c5321c8239..e5b793f07a 100755 --- a/examples/asyncapi.sse.kafka.proxy/.github/test.sh +++ b/examples/asyncapi.sse.kafka.proxy/.github/test.sh @@ -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" @@ -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 @@ -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 diff --git a/examples/asyncapi.sse.kafka.proxy/compose.yaml b/examples/asyncapi.sse.kafka.proxy/compose.yaml index ee3c370e35..89cd0a3294 100644 --- a/examples/asyncapi.sse.kafka.proxy/compose.yaml +++ b/examples/asyncapi.sse.kafka.proxy/compose.yaml @@ -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: diff --git a/examples/asyncapi.sse.kafka.proxy/kafka-asyncapi.yaml b/examples/asyncapi.sse.kafka.proxy/etc/specs/kafka-asyncapi.yaml similarity index 96% rename from examples/asyncapi.sse.kafka.proxy/kafka-asyncapi.yaml rename to examples/asyncapi.sse.kafka.proxy/etc/specs/kafka-asyncapi.yaml index d5a677394b..4a33dec62b 100644 --- a/examples/asyncapi.sse.kafka.proxy/kafka-asyncapi.yaml +++ b/examples/asyncapi.sse.kafka.proxy/etc/specs/kafka-asyncapi.yaml @@ -24,7 +24,7 @@ operations: traits: - $ref: "#/components/operationTraits/kafka" messages: - - $ref: "#/channels/eventstore/messages/event" + - $ref: "#/channels/events/messages/event" components: messages: event: diff --git a/examples/asyncapi.sse.kafka.proxy/sse-asyncapi.yaml b/examples/asyncapi.sse.kafka.proxy/etc/specs/sse-asyncapi.yaml similarity index 92% rename from examples/asyncapi.sse.kafka.proxy/sse-asyncapi.yaml rename to examples/asyncapi.sse.kafka.proxy/etc/specs/sse-asyncapi.yaml index 589ad3620b..103acbdf7f 100644 --- a/examples/asyncapi.sse.kafka.proxy/sse-asyncapi.yaml +++ b/examples/asyncapi.sse.kafka.proxy/etc/specs/sse-asyncapi.yaml @@ -7,7 +7,7 @@ info: servers: plain_sse: host: localhost:7114 - protocol: sse + protocol: http defaultContentType: application/json channels: @@ -22,6 +22,9 @@ operations: action: receive channel: $ref: "#/channels/events" + bindings: + x-zilla-sse: + method: "GET" components: schemas: