diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8024d1a35..419e015628 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,11 +33,14 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Build with Maven run: ./mvnw -B -U -nsu -Ddocker.logStdout -Dfailsafe.skipAfterFailureCount=1 -Ddocker.verbose install jacoco:report-aggregate + env: + GITHUB_ACTOR: ${{ github.actor }} + GITHUB_TOKEN: ${{ github.token }} - name: Conditional Artifact Upload uses: actions/upload-artifact@v4 if: failure() with: - name: zilla-build-${{ github.event.number }} + name: zilla-build-${{ matrix.java }}-${{ github.event.number }} path: | **/hs_err_pid*.log **/target/surefire-reports/ diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 3de9762eea..8b44379671 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -48,6 +48,12 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Setup JDK 17 + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 17 + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v3 @@ -74,6 +80,9 @@ jobs: # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild uses: github/codeql-action/autobuild@v3 + env: + GITHUB_ACTOR: ${{ github.actor }} + GITHUB_TOKEN: ${{ github.token }} # ℹ️ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun diff --git a/CHANGELOG.md b/CHANGELOG.md index 0098da6a19..30ae218f3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,36 @@ ## [Unreleased](https://github.com/aklivity/zilla/tree/HEAD) -[Full Changelog](https://github.com/aklivity/zilla/compare/0.9.81...HEAD) +[Full Changelog](https://github.com/aklivity/zilla/compare/0.9.82...HEAD) + +**Implemented enhancements:** + +- Add asyncapi http-kafka proxy example [\#1077](https://github.com/aklivity/zilla/issues/1077) +- Use miliseconds in metrics [\#1069](https://github.com/aklivity/zilla/issues/1069) +- Promote `filesystem` catalog out of incubator [\#1068](https://github.com/aklivity/zilla/issues/1068) +- Support `asyncapi` mapping `http` protocol to `kafka` protocol [\#1063](https://github.com/aklivity/zilla/issues/1063) +- Support filtering by kafka structured value field\(s\) [\#1062](https://github.com/aklivity/zilla/issues/1062) +- Support remote zilla configuration with change detection [\#1061](https://github.com/aklivity/zilla/issues/1061) +- Use full Event ID and the event name [\#1013](https://github.com/aklivity/zilla/issues/1013) +- Support configuration of MQTT Publish QoS maximum [\#970](https://github.com/aklivity/zilla/issues/970) +- Support `sse` server and client via `asyncapi` [\#952](https://github.com/aklivity/zilla/issues/952) +- Review kafka binding partition offset vs progress offset [\#285](https://github.com/aklivity/zilla/issues/285) + +**Fixed bugs:** + +- iNotify error when multiple Zilla instances are started in K8s Pods on a Portainer.io host [\#1081](https://github.com/aklivity/zilla/issues/1081) +- Running `emqtt_bench` `sub` triggers an exception [\#1037](https://github.com/aklivity/zilla/issues/1037) +- MqttSessionBeginEx missing packetIds in zilla dump [\#1028](https://github.com/aklivity/zilla/issues/1028) +- Running `emqtt_bench` triggers an exception in mqtt during the decoding [\#999](https://github.com/aklivity/zilla/issues/999) +- Intermittent NPE when trying to resolve guards [\#994](https://github.com/aklivity/zilla/issues/994) + +**Closed issues:** + +- Add SSE payload validation to sse-server binding [\#1076](https://github.com/aklivity/zilla/issues/1076) + +## [0.9.82](https://github.com/aklivity/zilla/tree/0.9.82) (2024-05-28) + +[Full Changelog](https://github.com/aklivity/zilla/compare/0.9.81...0.9.82) **Fixed bugs:** @@ -11,6 +40,15 @@ - Running `emqtt_bench` both `sub` and `pub` triggers an exception [\#1000](https://github.com/aklivity/zilla/issues/1000) - `http-kafka` will `fetch` messages that have been deleted by a retention policy [\#897](https://github.com/aklivity/zilla/issues/897) +**Merged pull requests:** + +- Update to handle catalog IT validation\(resolve schema from subject\) [\#1055](https://github.com/aklivity/zilla/pull/1055) ([aDaemonThread](https://github.com/aDaemonThread)) +- Queue as different kafka produce request if producerId or producerEpoch varies [\#1053](https://github.com/aklivity/zilla/pull/1053) ([akrambek](https://github.com/akrambek)) +- Support kafka cache bootstrap with topic default offset live [\#1052](https://github.com/aklivity/zilla/pull/1052) ([jfallows](https://github.com/jfallows)) +- Set decoder to ignoreAll after session is taken over by other MQTT client [\#1045](https://github.com/aklivity/zilla/pull/1045) ([bmaidics](https://github.com/bmaidics)) +- Add detection of non-compacted session topic [\#1044](https://github.com/aklivity/zilla/pull/1044) ([bmaidics](https://github.com/bmaidics)) +- Fix: http-kafka will fetch messages that have been deleted by a reten… [\#1033](https://github.com/aklivity/zilla/pull/1033) ([aDaemonThread](https://github.com/aDaemonThread)) + ## [0.9.81](https://github.com/aklivity/zilla/tree/0.9.81) (2024-05-24) [Full Changelog](https://github.com/aklivity/zilla/compare/0.9.80...0.9.81) diff --git a/build/flyweight-maven-plugin/pom.xml b/build/flyweight-maven-plugin/pom.xml index 7fe2d1eb72..6692db35fe 100644 --- a/build/flyweight-maven-plugin/pom.xml +++ b/build/flyweight-maven-plugin/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla build - 0.9.82 + 0.9.83 ../pom.xml @@ -17,8 +17,6 @@ zilla::build::flyweight-maven-plugin - 9 - 9 0.82 2 diff --git a/build/pom.xml b/build/pom.xml index 5e58384b6f..308a4332e5 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla zilla - 0.9.82 + 0.9.83 ../pom.xml diff --git a/cloud/docker-image/pom.xml b/cloud/docker-image/pom.xml index 60db60ec9b..7e7d0d3603 100644 --- a/cloud/docker-image/pom.xml +++ b/cloud/docker-image/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla cloud - 0.9.82 + 0.9.83 ../pom.xml @@ -253,6 +253,12 @@ ${project.version} runtime + + ${project.groupId} + filesystem-http + ${project.version} + runtime + ${project.groupId} metrics-stream diff --git a/cloud/docker-image/src/main/docker/Dockerfile b/cloud/docker-image/src/main/docker/Dockerfile index 6717305625..a0d0261cc9 100644 --- a/cloud/docker-image/src/main/docker/Dockerfile +++ b/cloud/docker-image/src/main/docker/Dockerfile @@ -13,7 +13,7 @@ # specific language governing permissions and limitations under the License. # -FROM eclipse-temurin:21-jdk AS build +FROM eclipse-temurin:22-jdk AS build COPY maven /root/.m2/repository @@ -25,7 +25,7 @@ RUN cat zpm.json.template | sed "s/\${VERSION}/${project.version}/g" | tee zpm.j RUN ./zpmw install --debug --exclude-remote-repositories RUN ./zpmw clean --keep-image -FROM ubuntu:jammy-20240427 +FROM ubuntu:jammy-20240530 ENV ZILLA_VERSION ${project.version} diff --git a/cloud/docker-image/src/main/docker/alpine.Dockerfile b/cloud/docker-image/src/main/docker/alpine.Dockerfile index 4dc74d18e9..83a763b034 100644 --- a/cloud/docker-image/src/main/docker/alpine.Dockerfile +++ b/cloud/docker-image/src/main/docker/alpine.Dockerfile @@ -27,7 +27,7 @@ RUN apk add --no-cache wget RUN ./zpmw install --debug --exclude-remote-repositories RUN ./zpmw clean --keep-image -FROM alpine:3.19.1 +FROM alpine:3.20.0 ENV ZILLA_VERSION ${project.version} diff --git a/cloud/docker-image/src/main/docker/assembly.xml b/cloud/docker-image/src/main/docker/assembly.xml index ca3954717b..7e0d989f1a 100644 --- a/cloud/docker-image/src/main/docker/assembly.xml +++ b/cloud/docker-image/src/main/docker/assembly.xml @@ -30,6 +30,7 @@ io/aklivity/zilla/binding-*/** io/aklivity/zilla/catalog-*/** io/aklivity/zilla/exporter-*/** + io/aklivity/zilla/filesystem-*/** io/aklivity/zilla/guard-*/** io/aklivity/zilla/metrics-*/** io/aklivity/zilla/model-*/** diff --git a/cloud/docker-image/src/main/docker/zpm.json.template b/cloud/docker-image/src/main/docker/zpm.json.template index 46961f11bb..7a792ce44d 100644 --- a/cloud/docker-image/src/main/docker/zpm.json.template +++ b/cloud/docker-image/src/main/docker/zpm.json.template @@ -50,6 +50,7 @@ "io.aklivity.zilla:exporter-otlp", "io.aklivity.zilla:exporter-prometheus", "io.aklivity.zilla:exporter-stdout", + "io.aklivity.zilla:filesystem-http", "io.aklivity.zilla:guard-jwt", "io.aklivity.zilla:metrics-stream", "io.aklivity.zilla:metrics-http", diff --git a/cloud/helm-chart/pom.xml b/cloud/helm-chart/pom.xml index 9851b6e26b..ed922aab4c 100644 --- a/cloud/helm-chart/pom.xml +++ b/cloud/helm-chart/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla cloud - 0.9.82 + 0.9.83 ../pom.xml diff --git a/cloud/helm-chart/src/main/helm/zilla/helmfile.yaml b/cloud/helm-chart/src/main/helm/zilla/helmfile.yaml new file mode 100644 index 0000000000..2aef15c088 --- /dev/null +++ b/cloud/helm-chart/src/main/helm/zilla/helmfile.yaml @@ -0,0 +1,15 @@ +helmDefaults: + wait: true + createNamespace: true + +releases: +- name: zilla + namespace: zilla + chart: oci://ghcr.io/aklivity/charts/zilla + version: ^0.9.0 + set: + # single value loaded from a local file, translates to --set-file zilla\\.yaml=zilla.yaml + # as described in: https://artifacthub.io/packages/helm/zilla/zilla#configuration + - name: "zilla\\.yaml" + file: zilla.yaml + diff --git a/cloud/helm-chart/src/main/helm/zilla/templates/deployment.yaml b/cloud/helm-chart/src/main/helm/zilla/templates/deployment.yaml index 73ea458bdd..55ed56c670 100644 --- a/cloud/helm-chart/src/main/helm/zilla/templates/deployment.yaml +++ b/cloud/helm-chart/src/main/helm/zilla/templates/deployment.yaml @@ -97,6 +97,11 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: + {{- if .Values.volumeMounts }} + {{- with .Values.volumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- end }} {{- if index .Values "zilla.yaml" }} - name: {{ include "zilla.fullname" . }} mountPath: {{ .Values.configPath }} @@ -127,6 +132,11 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} volumes: + {{- if .Values.volumes }} + {{- with .Values.volumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- end }} {{- if index .Values "zilla.yaml" }} - name: {{ include "zilla.fullname" . }} configMap: diff --git a/cloud/pom.xml b/cloud/pom.xml index 1646b94827..c484c32f63 100644 --- a/cloud/pom.xml +++ b/cloud/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla zilla - 0.9.82 + 0.9.83 ../pom.xml diff --git a/conf/pom.xml b/conf/pom.xml index 9b641dfcc4..33eee448db 100644 --- a/conf/pom.xml +++ b/conf/pom.xml @@ -8,16 +8,11 @@ io.aklivity.zilla zilla - 0.9.82 + 0.9.83 ../pom.xml conf zilla::conf - - 11 - 11 - - diff --git a/incubator/binding-amqp.spec/pom.xml b/incubator/binding-amqp.spec/pom.xml index 263615131a..2e142775d2 100644 --- a/incubator/binding-amqp.spec/pom.xml +++ b/incubator/binding-amqp.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 0.98 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -110,7 +108,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/incubator/binding-amqp.spec/src/main/java/io/aklivity/zilla/specs/binding/amqp/internal/AmqpFunctions.java b/incubator/binding-amqp.spec/src/main/java/io/aklivity/zilla/specs/binding/amqp/internal/AmqpFunctions.java index 10348ac0ba..4690f3f925 100644 --- a/incubator/binding-amqp.spec/src/main/java/io/aklivity/zilla/specs/binding/amqp/internal/AmqpFunctions.java +++ b/incubator/binding-amqp.spec/src/main/java/io/aklivity/zilla/specs/binding/amqp/internal/AmqpFunctions.java @@ -26,10 +26,10 @@ import org.agrona.DirectBuffer; import org.agrona.MutableDirectBuffer; import org.agrona.concurrent.UnsafeBuffer; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.specs.binding.amqp.internal.types.AmqpAnnotationFW; import io.aklivity.zilla.specs.binding.amqp.internal.types.AmqpApplicationPropertyFW; import io.aklivity.zilla.specs.binding.amqp.internal.types.AmqpBinaryFW; diff --git a/incubator/binding-amqp.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/incubator/binding-amqp.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from incubator/binding-amqp.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to incubator/binding-amqp.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/internal/AmqpFunctionsTest.java b/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/internal/AmqpFunctionsTest.java index 24c1392412..d4f8493025 100644 --- a/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/internal/AmqpFunctionsTest.java +++ b/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/internal/AmqpFunctionsTest.java @@ -15,6 +15,7 @@ */ package io.aklivity.zilla.specs.binding.amqp.internal; +import static io.aklivity.k3po.runtime.lang.internal.el.ExpressionFactoryUtils.newExpressionFactory; import static io.aklivity.zilla.specs.binding.amqp.internal.AmqpFunctions.abortEx; import static io.aklivity.zilla.specs.binding.amqp.internal.AmqpFunctions.beginEx; import static io.aklivity.zilla.specs.binding.amqp.internal.AmqpFunctions.binary32; @@ -55,7 +56,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import static org.kaazing.k3po.lang.internal.el.ExpressionFactoryUtils.newExpressionFactory; import java.nio.ByteBuffer; @@ -67,9 +67,9 @@ import org.agrona.concurrent.UnsafeBuffer; import org.junit.Before; import org.junit.Test; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.internal.el.ExpressionContext; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.internal.el.ExpressionContext; import io.aklivity.zilla.specs.binding.amqp.internal.AmqpFunctions.AmqpBeginExBuilder; import io.aklivity.zilla.specs.binding.amqp.internal.types.AmqpPropertiesFW; import io.aklivity.zilla.specs.binding.amqp.internal.types.stream.AmqpAbortExFW; diff --git a/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/application/StreamIT.java b/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/application/StreamIT.java index 67f981b4e6..5bd7355615 100644 --- a/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/application/StreamIT.java +++ b/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/application/StreamIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class StreamIT { diff --git a/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/network/ConnectionIT.java b/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/network/ConnectionIT.java index 1056eabf2a..b13c380295 100644 --- a/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/network/ConnectionIT.java +++ b/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/network/ConnectionIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ConnectionIT { diff --git a/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/network/LinkIT.java b/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/network/LinkIT.java index 6a42c827cb..4ab12b6161 100644 --- a/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/network/LinkIT.java +++ b/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/network/LinkIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class LinkIT { diff --git a/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/network/SessionIT.java b/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/network/SessionIT.java index 33af93a300..d686c2b5c4 100644 --- a/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/network/SessionIT.java +++ b/incubator/binding-amqp.spec/src/test/java/io/aklivity/zilla/specs/binding/amqp/streams/network/SessionIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class SessionIT { diff --git a/incubator/binding-amqp/pom.xml b/incubator/binding-amqp/pom.xml index 17e5b260b3..af6c107cf6 100644 --- a/incubator/binding-amqp/pom.xml +++ b/incubator/binding-amqp/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.71 1 @@ -66,13 +64,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -167,7 +165,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/incubator/binding-amqp/src/test/java/io/aklivity/zilla/runtime/binding/amqp/internal/stream/server/AdvisoryIT.java b/incubator/binding-amqp/src/test/java/io/aklivity/zilla/runtime/binding/amqp/internal/stream/server/AdvisoryIT.java index c38b02dd34..6de793b651 100644 --- a/incubator/binding-amqp/src/test/java/io/aklivity/zilla/runtime/binding/amqp/internal/stream/server/AdvisoryIT.java +++ b/incubator/binding-amqp/src/test/java/io/aklivity/zilla/runtime/binding/amqp/internal/stream/server/AdvisoryIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/incubator/binding-amqp/src/test/java/io/aklivity/zilla/runtime/binding/amqp/internal/stream/server/AmqpServerIT.java b/incubator/binding-amqp/src/test/java/io/aklivity/zilla/runtime/binding/amqp/internal/stream/server/AmqpServerIT.java index 2f3e2218b8..8cea06c1bb 100644 --- a/incubator/binding-amqp/src/test/java/io/aklivity/zilla/runtime/binding/amqp/internal/stream/server/AmqpServerIT.java +++ b/incubator/binding-amqp/src/test/java/io/aklivity/zilla/runtime/binding/amqp/internal/stream/server/AmqpServerIT.java @@ -32,9 +32,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/incubator/command-dump/pom.xml b/incubator/command-dump/pom.xml index cfcbf7e651..b2b7f67e65 100644 --- a/incubator/command-dump/pom.xml +++ b/incubator/command-dump/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 1.00 0 @@ -62,13 +60,13 @@ provided - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -182,7 +180,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/incubator/command-dump/src/main/resources/io/aklivity/zilla/runtime/command/dump/internal/airline/zilla.lua b/incubator/command-dump/src/main/resources/io/aklivity/zilla/runtime/command/dump/internal/airline/zilla.lua index 60bf401234..f2514b7e5b 100644 --- a/incubator/command-dump/src/main/resources/io/aklivity/zilla/runtime/command/dump/internal/airline/zilla.lua +++ b/incubator/command-dump/src/main/resources/io/aklivity/zilla/runtime/command/dump/internal/airline/zilla.lua @@ -436,6 +436,7 @@ local fields = { mqtt_ext_subscribe_qos_max = ProtoField.uint16("zilla.mqtt_ext.subscribe_qos_max", "Subscribe QoS Maximum", base.DEC), mqtt_ext_publish_qos_max = ProtoField.uint16("zilla.mqtt_ext.publish_qos_max", "Publish QoS Maximum", base.DEC), mqtt_ext_packet_size_max = ProtoField.uint32("zilla.mqtt_ext.packet_size_max", "Packet Size Maximum", base.DEC), + mqtt_ext_packet_ids_array_size = ProtoField.int8("zilla.mqtt_ext.packet_ids_array_size", "Size", base.DEC), -- capabilities mqtt_ext_capabilities = ProtoField.uint8("zilla.mqtt_ext.capabilities", "Capabilities", base.HEX), mqtt_ext_capabilities_retain = ProtoField.uint8("zilla.mqtt_ext.capabilities_retain", "RETAIN", @@ -1755,6 +1756,29 @@ function handle_mqtt_begin_session_extension(buffer, offset, ext_subtree) local client_id_length, slice_client_id_length, slice_client_id_text = dissect_length_value(buffer, client_id_offset, 2) add_string_as_subtree(buffer(client_id_offset, client_id_length), ext_subtree, "Client ID: %s", slice_client_id_length, slice_client_id_text, fields.mqtt_ext_client_id_length, fields.mqtt_ext_client_id) + -- packet_ids + local packet_ids_offset = client_id_offset + client_id_length + local next_offset = dissect_and_add_mqtt_packet_ids(buffer, packet_ids_offset, ext_subtree) +end + +function dissect_and_add_mqtt_packet_ids(buffer, offset, tree) + local size_length = 1 + local slice_array_size = buffer(offset, size_length) + local array_size = slice_array_size:le_int(); + local label = string.format("Packet IDs (%d items)", array_size) + local array_subtree = tree:add(zilla_protocol, slice_array_size, label) + array_subtree:add_le(fields.mqtt_ext_packet_ids_array_size, slice_array_size) + local item_offset = offset + size_length + for i = 1, array_size do + -- packet_id + local item_length = 2 + local slice_packet_id = buffer(item_offset, item_length) + local label = string.format("Packet ID: 0x%04x", slice_packet_id:le_int()) + local item_subtree = tree:add(zilla_protocol, slice_packet_id, label) + item_subtree:add_le(fields.mqtt_ext_packet_id, slice_packet_id) + item_offset = item_offset + item_length + end + return item_offset end function handle_mqtt_data_publish_extension(buffer, offset, ext_subtree) diff --git a/incubator/command-dump/src/main/scripts/io/aklivity/zilla/runtime/command/dump/binding/tls/streams/network/connection.established/client.rpt b/incubator/command-dump/src/main/scripts/io/aklivity/zilla/runtime/command/dump/binding/tls/streams/network/connection.established/client.rpt index baeb1fe4be..30ce31ec3f 100644 --- a/incubator/command-dump/src/main/scripts/io/aklivity/zilla/runtime/command/dump/binding/tls/streams/network/connection.established/client.rpt +++ b/incubator/command-dump/src/main/scripts/io/aklivity/zilla/runtime/command/dump/binding/tls/streams/network/connection.established/client.rpt @@ -19,6 +19,7 @@ connect "tls://localhost:9090" option tls:transport "zilla://streams/net0" option tls:trustStoreFile ${core:file('src/test/democa/client/trust')} option tls:trustStorePassword "generated" + option tls:cipherSuites "TLS_AES_256_GCM_SHA384" option zilla:ephemeral "test" option zilla:timestamps "false" option zilla:authorization ${authorization} diff --git a/incubator/command-dump/src/main/scripts/io/aklivity/zilla/runtime/command/dump/binding/tls/streams/network/connection.established/server.rpt b/incubator/command-dump/src/main/scripts/io/aklivity/zilla/runtime/command/dump/binding/tls/streams/network/connection.established/server.rpt index ef2b51cfd5..2c98b0fa1c 100644 --- a/incubator/command-dump/src/main/scripts/io/aklivity/zilla/runtime/command/dump/binding/tls/streams/network/connection.established/server.rpt +++ b/incubator/command-dump/src/main/scripts/io/aklivity/zilla/runtime/command/dump/binding/tls/streams/network/connection.established/server.rpt @@ -19,6 +19,7 @@ accept "tls://localhost:9090" option tls:transport "zilla://streams/net0" option tls:keyStoreFile ${core:file('src/test/democa/server/keys')} option tls:keyStorePassword "generated" + option tls:cipherSuites "TLS_AES_256_GCM_SHA384" option zilla:timestamps "false" option zilla:authorization ${authorization} option zilla:window 65536 diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/AmqpLinkNetworkIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/AmqpLinkNetworkIT.java index 532c87be16..92ce401f21 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/AmqpLinkNetworkIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/AmqpLinkNetworkIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class AmqpLinkNetworkIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/AmqpStreamApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/AmqpStreamApplicationIT.java index 82ebda73e8..2cd83d50bc 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/AmqpStreamApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/AmqpStreamApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class AmqpStreamApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/FileSystemApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/FileSystemApplicationIT.java index 2f9fba05cb..b510f10724 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/FileSystemApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/FileSystemApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class FileSystemApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/GrpcServerStreamRpcApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/GrpcServerStreamRpcApplicationIT.java index e43237ad36..d9be61b006 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/GrpcServerStreamRpcApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/GrpcServerStreamRpcApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class GrpcServerStreamRpcApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/Http2AuthorizationApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/Http2AuthorizationApplicationIT.java index af8ea39f9b..0a997caee3 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/Http2AuthorizationApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/Http2AuthorizationApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class Http2AuthorizationApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/Http2AuthorizationNetworkIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/Http2AuthorizationNetworkIT.java index af9d8b3fb4..ce38764dde 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/Http2AuthorizationNetworkIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/Http2AuthorizationNetworkIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class Http2AuthorizationNetworkIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaDescribeApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaDescribeApplicationIT.java index 7d368e082c..0cbc56e704 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaDescribeApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaDescribeApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class KafkaDescribeApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaDescribeConfigsNetworkIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaDescribeConfigsNetworkIT.java index 02a56dda71..5492e29c23 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaDescribeConfigsNetworkIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaDescribeConfigsNetworkIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class KafkaDescribeConfigsNetworkIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaFetchApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaFetchApplicationIT.java index 1a6320c645..641a123d32 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaFetchApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaFetchApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class KafkaFetchApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaGroupApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaGroupApplicationIT.java index 390cb35616..50ea4907bf 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaGroupApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaGroupApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class KafkaGroupApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaInitProducerIdApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaInitProducerIdApplicationIT.java index 34bfa3cfc3..8e6ee19b3d 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaInitProducerIdApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaInitProducerIdApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class KafkaInitProducerIdApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaMergedApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaMergedApplicationIT.java index 8ba4b53d5b..7879a458cb 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaMergedApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaMergedApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class KafkaMergedApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaMetaApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaMetaApplicationIT.java index ac0453200d..786e2e6941 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaMetaApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaMetaApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class KafkaMetaApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaOffsetCommitApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaOffsetCommitApplicationIT.java index 3f7ad2f928..b443f07a61 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaOffsetCommitApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaOffsetCommitApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class KafkaOffsetCommitApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaOffsetFetchApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaOffsetFetchApplicationIT.java index 2d510ed522..9b2fcf5c3f 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaOffsetFetchApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaOffsetFetchApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class KafkaOffsetFetchApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaProduceApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaProduceApplicationIT.java index 27b65ccea9..896c403d73 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaProduceApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/KafkaProduceApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class KafkaProduceApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/MqttPublishApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/MqttPublishApplicationIT.java index 42dce7b92d..a84eec4f6d 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/MqttPublishApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/MqttPublishApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class MqttPublishApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/MqttPublishNetworkIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/MqttPublishNetworkIT.java index 6b6885aa53..bce1d762df 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/MqttPublishNetworkIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/MqttPublishNetworkIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class MqttPublishNetworkIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/MqttSubscribeApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/MqttSubscribeApplicationIT.java index baeced6908..e13570da1d 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/MqttSubscribeApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/MqttSubscribeApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class MqttSubscribeApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/ProxyApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/ProxyApplicationIT.java index 84bfe12f51..3b411afd15 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/ProxyApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/ProxyApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class ProxyApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/SseDataApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/SseDataApplicationIT.java index ee638426ae..8113305b4d 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/SseDataApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/SseDataApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class SseDataApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/TlsApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/TlsApplicationIT.java index ab54aae486..fb11dcbd43 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/TlsApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/TlsApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class TlsApplicationIT diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/TlsNetworkIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/TlsNetworkIT.java index 714f1e51b5..6864b2054e 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/TlsNetworkIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/TlsNetworkIT.java @@ -17,15 +17,14 @@ import static java.util.concurrent.TimeUnit.SECONDS; import static org.junit.rules.RuleChain.outerRule; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class TlsNetworkIT @@ -42,7 +41,6 @@ public class TlsNetworkIT @Rule public final TestRule chain = outerRule(dump).around(k3po).around(timeout); - @Ignore @Test @Specification({ "${net}/connection.established/client", diff --git a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/WsAdvisoryApplicationIT.java b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/WsAdvisoryApplicationIT.java index b5e77248c9..4837c48fa3 100644 --- a/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/WsAdvisoryApplicationIT.java +++ b/incubator/command-dump/src/test/java/io/aklivity/zilla/runtime/command/dump/internal/WsAdvisoryApplicationIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.command.dump.internal.test.DumpRule; public class WsAdvisoryApplicationIT diff --git a/incubator/command-dump/src/test/resources/io/aklivity/zilla/runtime/command/dump/internal/MqttPublishApplicationIT_shouldSendOneMessage.txt b/incubator/command-dump/src/test/resources/io/aklivity/zilla/runtime/command/dump/internal/MqttPublishApplicationIT_shouldSendOneMessage.txt index dc9ddd9f38..86a3b369d2 100644 --- a/incubator/command-dump/src/test/resources/io/aklivity/zilla/runtime/command/dump/internal/MqttPublishApplicationIT_shouldSendOneMessage.txt +++ b/incubator/command-dump/src/test/resources/io/aklivity/zilla/runtime/command/dump/internal/MqttPublishApplicationIT_shouldSendOneMessage.txt @@ -45,6 +45,8 @@ Zilla Frame Client ID: client Length: 6 Client ID: client + Packet IDs (-1 items) + Size: -1 Frame 2: 230 bytes on wire (1840 bits), 230 bytes captured (1840 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) @@ -93,6 +95,8 @@ Zilla Frame Client ID: client Length: 6 Client ID: client + Packet IDs (-1 items) + Size: -1 Frame 3: 211 bytes on wire (1688 bits), 211 bytes captured (1688 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) diff --git a/incubator/command-dump/src/test/resources/io/aklivity/zilla/runtime/command/dump/internal/MqttSubscribeApplicationIT_shouldReceiveOneMessage.txt b/incubator/command-dump/src/test/resources/io/aklivity/zilla/runtime/command/dump/internal/MqttSubscribeApplicationIT_shouldReceiveOneMessage.txt index d19231b7ce..5a0f56ff1d 100644 --- a/incubator/command-dump/src/test/resources/io/aklivity/zilla/runtime/command/dump/internal/MqttSubscribeApplicationIT_shouldReceiveOneMessage.txt +++ b/incubator/command-dump/src/test/resources/io/aklivity/zilla/runtime/command/dump/internal/MqttSubscribeApplicationIT_shouldReceiveOneMessage.txt @@ -45,6 +45,8 @@ Zilla Frame Client ID: client Length: 6 Client ID: client + Packet IDs (-1 items) + Size: -1 Frame 2: 230 bytes on wire (1840 bits), 230 bytes captured (1840 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) @@ -93,6 +95,8 @@ Zilla Frame Client ID: client Length: 6 Client ID: client + Packet IDs (-1 items) + Size: -1 Frame 3: 211 bytes on wire (1688 bits), 211 bytes captured (1688 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) diff --git a/incubator/command-dump/src/test/resources/io/aklivity/zilla/runtime/command/dump/internal/TlsNetworkIT_shouldEstablishConnection.txt b/incubator/command-dump/src/test/resources/io/aklivity/zilla/runtime/command/dump/internal/TlsNetworkIT_shouldEstablishConnection.txt index 3d03b419b8..9e9f90aea6 100644 --- a/incubator/command-dump/src/test/resources/io/aklivity/zilla/runtime/command/dump/internal/TlsNetworkIT_shouldEstablishConnection.txt +++ b/incubator/command-dump/src/test/resources/io/aklivity/zilla/runtime/command/dump/internal/TlsNetworkIT_shouldEstablishConnection.txt @@ -124,10 +124,10 @@ Zilla Frame Progress: 0 Progress/Maximum: 0/65536 -Frame 5: 693 bytes on wire (5544 bits), 693 bytes captured (5544 bits) +Frame 5: 548 bytes on wire (4384 bits), 548 bytes captured (4384 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:2, Dst: fe80::3f3f:0:0:3 -Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 265, Ack: 266, Len: 619 +Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 265, Ack: 266, Len: 474 Zilla Frame Frame Type ID: 0x00000002 Frame Type: DATA @@ -157,25 +157,25 @@ Zilla Frame .... .0.. = INCOMPLETE: Not set (0) .... 0... = SKIP: Not set (0) Budget ID: 0x0000000000000000 - Reserved: 482 - Progress: 482 - Progress/Maximum: 482/65536 + Reserved: 337 + Progress: 337 + Progress/Maximum: 337/65536 Payload - Length: 482 + Length: 337 Payload Transport Layer Security Frame 6: 211 bytes on wire (1688 bits), 211 bytes captured (1688 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:2, Dst: fe80::3f3f:0:0:3 -Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 884, Ack: 266, Len: 137 +Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 739, Ack: 266, Len: 137 Zilla Frame Frame Type ID: 0x40000002 Frame Type: WINDOW Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x000003b0 + Offset: 0x00000320 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -186,8 +186,8 @@ Zilla Frame Initial ID: 0x3f3f000000000003 Reply ID: 0x3f3f000000000002 Direction: INI - Sequence: 482 - Acknowledge: 482 + Sequence: 337 + Acknowledge: 337 Maximum: 65536 Timestamp: 0x0000000000000000 Trace ID: 0x8000000000000006 @@ -202,14 +202,14 @@ Zilla Frame Frame 7: 338 bytes on wire (2704 bits), 338 bytes captured (2704 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:3, Dst: fe80::3f3f:0:0:2 -Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 266, Ack: 1021, Len: 264 +Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 266, Ack: 876, Len: 264 Zilla Frame Frame Type ID: 0x00000002 Frame Type: DATA Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x00000410 + Offset: 0x00000380 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -243,14 +243,14 @@ Transport Layer Security Frame 8: 217 bytes on wire (1736 bits), 217 bytes captured (1736 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:3, Dst: fe80::3f3f:0:0:2 -Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 530, Ack: 1021, Len: 143 +Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 530, Ack: 876, Len: 143 Zilla Frame Frame Type ID: 0x00000002 Frame Type: DATA Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x000004f0 + Offset: 0x00000460 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -284,14 +284,14 @@ Transport Layer Security Frame 9: 2433 bytes on wire (19464 bits), 2433 bytes captured (19464 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:3, Dst: fe80::3f3f:0:0:2 -Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 673, Ack: 1021, Len: 2359 +Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 673, Ack: 876, Len: 2359 Zilla Frame Frame Type ID: 0x00000002 Frame Type: DATA Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x00000558 + Offset: 0x000004c8 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -325,14 +325,14 @@ Transport Layer Security Frame 10: 211 bytes on wire (1688 bits), 211 bytes captured (1688 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:3, Dst: fe80::3f3f:0:0:2 -Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 3032, Ack: 1021, Len: 137 +Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 3032, Ack: 876, Len: 137 Zilla Frame Frame Type ID: 0x40000002 Frame Type: WINDOW Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x00000e68 + Offset: 0x00000dd8 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -359,14 +359,14 @@ Zilla Frame Frame 11: 211 bytes on wire (1688 bits), 211 bytes captured (1688 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:3, Dst: fe80::3f3f:0:0:2 -Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 3169, Ack: 1021, Len: 137 +Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 3169, Ack: 876, Len: 137 Zilla Frame Frame Type ID: 0x40000002 Frame Type: WINDOW Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x00000ec8 + Offset: 0x00000e38 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -393,14 +393,14 @@ Zilla Frame Frame 12: 211 bytes on wire (1688 bits), 211 bytes captured (1688 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:3, Dst: fe80::3f3f:0:0:2 -Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 3306, Ack: 1021, Len: 137 +Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 3306, Ack: 876, Len: 137 Zilla Frame Frame Type ID: 0x40000002 Frame Type: WINDOW Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x00000f28 + Offset: 0x00000e98 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -427,14 +427,14 @@ Zilla Frame Frame 13: 217 bytes on wire (1736 bits), 217 bytes captured (1736 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:2, Dst: fe80::3f3f:0:0:3 -Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 1021, Ack: 3443, Len: 143 +Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 876, Ack: 3443, Len: 143 Zilla Frame Frame Type ID: 0x00000002 Frame Type: DATA Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x00000f88 + Offset: 0x00000ef8 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -445,8 +445,8 @@ Zilla Frame Initial ID: 0x3f3f000000000003 Reply ID: 0x3f3f000000000002 Direction: INI - Sequence: 482 - Acknowledge: 482 + Sequence: 337 + Acknowledge: 337 Maximum: 65536 Timestamp: 0x0000000000000000 Trace ID: 0x800000000000000d @@ -468,14 +468,14 @@ Transport Layer Security Frame 14: 301 bytes on wire (2408 bits), 301 bytes captured (2408 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:2, Dst: fe80::3f3f:0:0:3 -Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 1164, Ack: 3443, Len: 227 +Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 1019, Ack: 3443, Len: 227 Zilla Frame Frame Type ID: 0x00000002 Frame Type: DATA Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x00000ff0 + Offset: 0x00000f60 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -486,8 +486,8 @@ Zilla Frame Initial ID: 0x3f3f000000000003 Reply ID: 0x3f3f000000000002 Direction: INI - Sequence: 488 - Acknowledge: 482 + Sequence: 343 + Acknowledge: 337 Maximum: 65536 Timestamp: 0x0000000000000000 Trace ID: 0x800000000000000e @@ -509,14 +509,14 @@ Transport Layer Security Frame 15: 251 bytes on wire (2008 bits), 251 bytes captured (2008 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:2, Dst: fe80::3f3f:0:0:3 -Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 1391, Ack: 3443, Len: 177 +Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 1246, Ack: 3443, Len: 177 Zilla Frame Frame Type ID: 0x00000002 Frame Type: DATA Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x000010a8 + Offset: 0x00001018 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -527,8 +527,8 @@ Zilla Frame Initial ID: 0x3f3f000000000003 Reply ID: 0x3f3f000000000002 Direction: INI - Sequence: 578 - Acknowledge: 482 + Sequence: 433 + Acknowledge: 337 Maximum: 65536 Timestamp: 0x0000000000000000 Trace ID: 0x800000000000000f @@ -550,14 +550,14 @@ Transport Layer Security Frame 16: 211 bytes on wire (1688 bits), 211 bytes captured (1688 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:2, Dst: fe80::3f3f:0:0:3 -Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 1568, Ack: 3443, Len: 137 +Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 1423, Ack: 3443, Len: 137 Zilla Frame Frame Type ID: 0x40000002 Frame Type: WINDOW Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x00001130 + Offset: 0x000010a0 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -568,8 +568,8 @@ Zilla Frame Initial ID: 0x3f3f000000000003 Reply ID: 0x3f3f000000000002 Direction: INI - Sequence: 488 - Acknowledge: 488 + Sequence: 343 + Acknowledge: 343 Maximum: 65536 Timestamp: 0x0000000000000000 Trace ID: 0x8000000000000010 @@ -584,14 +584,14 @@ Zilla Frame Frame 17: 211 bytes on wire (1688 bits), 211 bytes captured (1688 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:2, Dst: fe80::3f3f:0:0:3 -Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 1705, Ack: 3443, Len: 137 +Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 1560, Ack: 3443, Len: 137 Zilla Frame Frame Type ID: 0x40000002 Frame Type: WINDOW Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x00001190 + Offset: 0x00001100 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -602,8 +602,8 @@ Zilla Frame Initial ID: 0x3f3f000000000003 Reply ID: 0x3f3f000000000002 Direction: INI - Sequence: 578 - Acknowledge: 578 + Sequence: 433 + Acknowledge: 433 Maximum: 65536 Timestamp: 0x0000000000000000 Trace ID: 0x8000000000000011 @@ -618,14 +618,14 @@ Zilla Frame Frame 18: 211 bytes on wire (1688 bits), 211 bytes captured (1688 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:2, Dst: fe80::3f3f:0:0:3 -Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 1842, Ack: 3443, Len: 137 +Transmission Control Protocol, Src Port: 0, Dst Port: 7114, Seq: 1697, Ack: 3443, Len: 137 Zilla Frame Frame Type ID: 0x40000002 Frame Type: WINDOW Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x000011f0 + Offset: 0x00001160 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -636,8 +636,8 @@ Zilla Frame Initial ID: 0x3f3f000000000003 Reply ID: 0x3f3f000000000002 Direction: INI - Sequence: 618 - Acknowledge: 618 + Sequence: 473 + Acknowledge: 473 Maximum: 65536 Timestamp: 0x0000000000000000 Trace ID: 0x8000000000000012 @@ -649,17 +649,17 @@ Zilla Frame Progress: 0 Progress/Maximum: 0/65536 -Frame 19: 2354 bytes on wire (18832 bits), 2354 bytes captured (18832 bits) +Frame 19: 2344 bytes on wire (18752 bits), 2344 bytes captured (18752 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:3, Dst: fe80::3f3f:0:0:2 -Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 3443, Ack: 1979, Len: 2280 +Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 3443, Ack: 1834, Len: 2270 Zilla Frame Frame Type ID: 0x00000002 Frame Type: DATA Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x00001250 + Offset: 0x000011c0 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -682,25 +682,25 @@ Zilla Frame .... .0.. = INCOMPLETE: Not set (0) .... 0... = SKIP: Not set (0) Budget ID: 0x0000000000000000 - Reserved: 2143 - Progress: 2143 - Progress/Maximum: 2143/65536 + Reserved: 2133 + Progress: 2133 + Progress/Maximum: 2133/65536 Payload - Length: 2143 + Length: 2133 Payload Transport Layer Security Frame 20: 194 bytes on wire (1552 bits), 194 bytes captured (1552 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:3, Dst: fe80::3f3f:0:0:2 -Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 5723, Ack: 1979, Len: 120 +Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 5713, Ack: 1834, Len: 120 Zilla Frame Frame Type ID: 0x00000003 Frame Type: END Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x00001b10 + Offset: 0x00001a78 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -711,7 +711,7 @@ Zilla Frame Initial ID: 0x3f3f000000000003 Reply ID: 0x3f3f000000000002 Direction: REP - Sequence: 4498 + Sequence: 4488 Acknowledge: 2355 Maximum: 65536 Timestamp: 0x0000000000000000 @@ -721,14 +721,14 @@ Zilla Frame Frame 21: 211 bytes on wire (1688 bits), 211 bytes captured (1688 bits) Ethernet II, Src: Send_00 (20:53:45:4e:44:00), Dst: Receive_00 (20:52:45:43:56:00) Internet Protocol Version 6, Src: fe80::3f3f:0:0:3, Dst: fe80::3f3f:0:0:2 -Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 5843, Ack: 1979, Len: 137 +Transmission Control Protocol, Src Port: 7114, Dst Port: 0, Seq: 5833, Ack: 1834, Len: 137 Zilla Frame Frame Type ID: 0x40000002 Frame Type: WINDOW Protocol Type ID: 0x99f321bc Protocol Type: tls Worker: 0 - Offset: 0x00001b60 + Offset: 0x00001ac8 Origin ID: 0x0000000100000002 Origin Namespace: test Origin Binding: net0 @@ -739,8 +739,8 @@ Zilla Frame Initial ID: 0x3f3f000000000003 Reply ID: 0x3f3f000000000002 Direction: REP - Sequence: 4498 - Acknowledge: 4498 + Sequence: 4488 + Acknowledge: 4488 Maximum: 65536 Timestamp: 0x0000000000000000 Trace ID: 0x8000000000000015 diff --git a/incubator/command-log/pom.xml b/incubator/command-log/pom.xml index efd7bcd6a6..df3d789626 100644 --- a/incubator/command-log/pom.xml +++ b/incubator/command-log/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 1.00 0 diff --git a/incubator/command-tune/pom.xml b/incubator/command-tune/pom.xml index 8bf9760c40..23fcd9f678 100644 --- a/incubator/command-tune/pom.xml +++ b/incubator/command-tune/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 1.00 0 diff --git a/incubator/pom.xml b/incubator/pom.xml index 4646e235ca..7aa00bfaa1 100644 --- a/incubator/pom.xml +++ b/incubator/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla zilla - 0.9.82 + 0.9.83 ../pom.xml @@ -21,9 +21,6 @@ binding-amqp - catalog-filesystem.spec - catalog-filesystem - command-log command-dump command-tune @@ -36,11 +33,6 @@ binding-amqp ${project.version} - - ${project.groupId} - catalog-filesystem - ${project.version} - ${project.groupId} command-log diff --git a/manager/pom.xml b/manager/pom.xml index c9e5682f37..49a3dd5465 100644 --- a/manager/pom.xml +++ b/manager/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla zilla - 0.9.82 + 0.9.83 ../pom.xml @@ -16,8 +16,6 @@ zilla::manager - 11 - 11 0.61 0 diff --git a/manager/src/main/java/org/apache/ivy/util/url/IvyAuthenticator.java b/manager/src/main/java/org/apache/ivy/util/url/IvyAuthenticator.java index 26935695b4..57e3b943d0 100644 --- a/manager/src/main/java/org/apache/ivy/util/url/IvyAuthenticator.java +++ b/manager/src/main/java/org/apache/ivy/util/url/IvyAuthenticator.java @@ -17,6 +17,8 @@ */ package org.apache.ivy.util.url; +import static org.apache.ivy.util.StringUtils.isNullOrEmpty; + import java.lang.reflect.Field; import java.lang.reflect.Method; import java.net.Authenticator; @@ -25,8 +27,6 @@ import org.apache.ivy.util.Credentials; import org.apache.ivy.util.Message; -import static org.apache.ivy.util.StringUtils.isNullOrEmpty; - /** * */ diff --git a/pom.xml b/pom.xml index e111f46c9e..511890a517 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ 4.0.0 io.aklivity.zilla zilla - 0.9.82 + 0.9.83 pom zilla https://github.com/aklivity/zilla @@ -34,14 +34,24 @@ - github - https://maven.pkg.github.com/aklivity/packages/ + aklivity + https://maven.packages.aklivity.io/ + + + aklivity + https://maven.packages.aklivity.io/ + + + UTF-8 UTF-8 + 17 + 17 + 17 io/aklivity/zilla/conf/checkstyle/configuration.xml io/aklivity/zilla/conf/checkstyle/suppressions.xml 4.13.0 @@ -51,7 +61,7 @@ 4.0.22 2.6.0 5.8.0 - 3.1.0 + 3.3.0 1.37 @@ -195,18 +205,18 @@ 0.1.4 - org.kaazing - k3po.driver + io.aklivity.k3po + driver ${k3po.version} - org.kaazing - k3po.lang + io.aklivity.k3po + lang ${k3po.version} - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit ${k3po.version} @@ -320,6 +330,7 @@ 3.1.2 true + **/generated-*/**/* @@ -439,7 +450,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin ${k3po.version} @@ -668,7 +679,7 @@ No Snapshots Allowed! - [13,14) + [17,18) release diff --git a/runtime/binding-asyncapi/pom.xml b/runtime/binding-asyncapi/pom.xml index 811e313493..9faf4857f8 100644 --- a/runtime/binding-asyncapi/pom.xml +++ b/runtime/binding-asyncapi/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.60 4 @@ -61,6 +59,12 @@ ${project.version} provided + + io.aklivity.zilla + binding-sse + ${project.version} + provided + io.aklivity.zilla binding-kafka @@ -79,6 +83,18 @@ ${project.version} provided + + io.aklivity.zilla + binding-http-kafka + ${project.version} + provided + + + io.aklivity.zilla + binding-sse-kafka + ${project.version} + provided + io.aklivity.zilla binding-tls @@ -141,13 +157,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -157,6 +173,20 @@ ${project.version} test + + io.aklivity.zilla + binding-http-kafka + test-jar + ${project.version} + test + + + io.aklivity.zilla + binding-sse-kafka + test-jar + ${project.version} + test + org.openjdk.jmh jmh-core @@ -176,7 +206,7 @@ flyweight-maven-plugin ${project.version} - core mqtt http kafka asyncapi + core mqtt http sse kafka asyncapi io.aklivity.zilla.runtime.binding.asyncapi.internal.types @@ -211,11 +241,13 @@ io/aklivity/zilla/specs/binding/asyncapi/schema/asyncapi.schema.patch.json, io/aklivity/zilla/specs/binding/mqtt/kafka/schema/mqtt.kafka.schema.patch.json, io/aklivity/zilla/specs/binding/http/schema/http.schema.patch.json, + io/aklivity/zilla/specs/binding/sse/schema/sse.schema.patch.json, io/aklivity/zilla/specs/binding/kafka/schema/kafka.schema.patch.json, io/aklivity/zilla/specs/binding/tcp/schema/tcp.schema.patch.json, io/aklivity/zilla/specs/binding/tls/schema/tls.schema.patch.json, io/aklivity/zilla/specs/binding/asyncapi/schema/asyncapi.2.6.0.schema.json, - io/aklivity/zilla/specs/binding/asyncapi/schema/asyncapi.3.0.1.schema.json + io/aklivity/zilla/specs/binding/asyncapi/schema/asyncapi.3.0.1.schema.json, + io/aklivity/zilla/specs/binding/asyncapi/schema/asyncapi.3.0.2-zilla.schema.json ${project.build.directory}/classes @@ -280,7 +312,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/config/AsyncapiParser.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/config/AsyncapiParser.java index 759cd8ff63..18b5765b62 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/config/AsyncapiParser.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/config/AsyncapiParser.java @@ -42,15 +42,16 @@ public class AsyncapiParser { - private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d\\.\\d)\\.\\d+"); + private static final Pattern VERSION_PATTERN = Pattern.compile("(?!\\.)(\\d+(\\.\\d+)+)(?:[-.][a-zA-Z]+)?(?![\\d.])$"); private final Map schemas; public AsyncapiParser() { Map schemas = new Object2ObjectHashMap<>(); - schemas.put("2.6", schema("2.6.0")); - schemas.put("3.0", schema("3.0.1")); + schemas.put("2.6.0", schema("2.6.0")); + schemas.put("3.0.0", schema("3.0.1")); + schemas.put("3.0.2-zilla", schema("3.0.2-zilla")); this.schemas = unmodifiableMap(schemas); } @@ -115,8 +116,7 @@ private String detectAsyncApiVersion( final String versionString = json.getString("asyncapi"); final Matcher matcher = VERSION_PATTERN.matcher(versionString); - final String majorMinorVersion = matcher.matches() ? matcher.group(1) : null; - return majorMinorVersion; + return matcher.matches() ? matcher.group(0) : null; } else { diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiBindingConfig.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiBindingConfig.java index e8b130ec05..dd236f8f38 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiBindingConfig.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiBindingConfig.java @@ -16,12 +16,14 @@ import static io.aklivity.zilla.runtime.engine.config.KindConfig.CACHE_CLIENT; import static io.aklivity.zilla.runtime.engine.config.KindConfig.PROXY; +import static io.aklivity.zilla.runtime.engine.config.KindConfig.SERVER; import static java.util.stream.Collectors.toList; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.TreeMap; import java.util.function.Consumer; import java.util.function.LongFunction; @@ -43,10 +45,13 @@ import io.aklivity.zilla.runtime.binding.asyncapi.config.AsyncapiParser; import io.aklivity.zilla.runtime.binding.asyncapi.config.AsyncapiSchemaConfig; import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.Asyncapi; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiBinding; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.HttpHeaderFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.String16FW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.String8FW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.HttpBeginExFW; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.MqttBeginExFW; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.SseBeginExFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.view.AsyncapiServerView; import io.aklivity.zilla.runtime.engine.catalog.CatalogHandler; import io.aklivity.zilla.runtime.engine.config.BindingConfig; @@ -56,6 +61,8 @@ public final class AsyncapiBindingConfig { + public static final String SEND_OPERATION = "send"; + public static final String RECEIVE_OPERATION = "receive"; public final long id; public final String name; public final KindConfig kind; @@ -63,13 +70,17 @@ public final class AsyncapiBindingConfig public final List routes; private final Int2ObjectHashMap typesByNamespaceId; - private final Int2ObjectHashMap composites; + private final Int2ObjectHashMap composites; private final Long2LongHashMap apiIdsByNamespaceId; private final AsyncapiNamespaceGenerator namespaceGenerator; - private final Long2LongHashMap compositeResolvedIds; + private final Object2LongHashMap compositeResolvedIds; private final Object2ObjectHashMap paths; + private final Object2ObjectHashMap topics; private final Object2LongHashMap schemaIdsByApiId; private final Map operationIds; + private final Map> operationBindings; + private final Map receiveOperationIds; + private final Map sendOperationIds; private final LongFunction supplyCatalog; private final ToLongFunction resolveId; private final Consumer attach; @@ -96,11 +107,15 @@ public AsyncapiBindingConfig( this.options = (AsyncapiOptionsConfig) binding.options; this.composites = new Int2ObjectHashMap<>(); this.apiIdsByNamespaceId = new Long2LongHashMap(-1); - this.compositeResolvedIds = new Long2LongHashMap(-1); + this.compositeResolvedIds = new Object2LongHashMap<>(-1); this.schemaIdsByApiId = new Object2LongHashMap<>(-1); this.typesByNamespaceId = new Int2ObjectHashMap<>(); this.paths = new Object2ObjectHashMap<>(); + this.topics = new Object2ObjectHashMap<>(); this.operationIds = new TreeMap<>(CharSequence::compare); + this.operationBindings = new HashMap<>(); + this.receiveOperationIds = new TreeMap<>(CharSequence::compare); + this.sendOperationIds = new TreeMap<>(CharSequence::compare); this.helper = new HttpHeaderHelper(); this.parser = new AsyncapiParser(); this.attach = attachComposite; @@ -114,16 +129,11 @@ public boolean isCompositeOriginId( return typesByNamespaceId.containsKey(NamespacedId.namespaceId(originId)); } - public String getCompositeOriginType( - long originId) - { - return typesByNamespaceId.get(NamespacedId.namespaceId(originId)); - } - public long resolveCompositeResolvedId( - long apiId) + long apiId, + String type) { - return overrideRouteId != -1 ? overrideRouteId : compositeResolvedIds.get(apiId); + return overrideRouteId != -1 ? overrideRouteId : compositeResolvedIds.get(apiId + type); } public long resolveApiId( @@ -138,7 +148,48 @@ public long resolveApiId( return schemaIdsByApiId.get(apiId); } - public String resolveOperationId( + public String resolveMqttOperationId( + MqttBeginExFW mqttBeginEx) + { + String topic; + String operationId = null; + + switch (mqttBeginEx.kind()) + { + case MqttBeginExFW.KIND_PUBLISH: + topic = mqttBeginEx.publish().topic().asString(); + for (Map.Entry item : paths.entrySet()) + { + Matcher matcher = item.getKey(); + matcher.reset(topic); + if (matcher.find()) + { + String channelName = item.getValue(); + operationId = sendOperationIds.get(channelName); + break; + } + } + break; + case MqttBeginExFW.KIND_SUBSCRIBE: + topic = mqttBeginEx.subscribe().filters().matchFirst(x -> true).pattern().asString(); + for (Map.Entry item : paths.entrySet()) + { + Matcher matcher = item.getKey(); + matcher.reset(topic); + if (matcher.find()) + { + String channelName = item.getValue(); + operationId = receiveOperationIds.get(channelName); + break; + } + } + break; + } + + return operationId; + } + + public String resolveHttpOperationId( HttpBeginExFW httpBeginEx) { helper.visit(httpBeginEx); @@ -160,6 +211,26 @@ public String resolveOperationId( return operationId; } + public String resolveSseOperationId( + SseBeginExFW sseBeginEx) + { + String operationId = null; + + for (Map.Entry item : paths.entrySet()) + { + Matcher matcher = item.getKey(); + matcher.reset(sseBeginEx.path().asString()); + if (matcher.find()) + { + String channelName = item.getValue(); + operationId = operationIds.get(channelName); + break; + } + } + + return operationId; + } + public AsyncapiRouteConfig resolve( long authorization) { @@ -193,14 +264,37 @@ public void attach( attachServerClientBinding(binding, configs); } - for (Map.Entry entry : composites.entrySet()) + for (Map.Entry entry : composites.entrySet()) { Integer k = entry.getKey(); - NamespaceConfig v = entry.getValue(); - List bindings = v.bindings.stream() - .filter(b -> b.type.equals("mqtt") || b.type.equals("http") || - b.type.equals("kafka") && b.kind == CACHE_CLIENT || b.type.equals("mqtt-kafka")) - .collect(toList()); + CompositeNamespace v = entry.getValue(); + NamespaceConfig namespaceConfig = v.composite; + List bindings; + boolean containsSse = namespaceConfig.bindings.stream().anyMatch(b -> b.type.equals("sse")); + if (containsSse) + { + if (binding.kind.equals(SERVER)) + { + bindings = namespaceConfig.bindings.stream() + .filter(b -> b.type.equals("http") || b.type.equals("http-kafka") || b.type.equals("sse")) + .collect(toList()); + } + else + { + bindings = namespaceConfig.bindings.stream() + .filter(b -> b.type.equals("sse")) + .collect(toList()); + } + } + else + { + bindings = namespaceConfig.bindings.stream() + .filter(b -> b.type.equals("mqtt") || b.type.equals("http") || b.type.equals("sse") || + b.type.equals("kafka") && b.kind == CACHE_CLIENT || b.type.equals("mqtt-kafka") || + b.type.equals("http-kafka") || b.type.equals("sse-kafka")) + .collect(toList()); + } + extractResolveId(k, bindings); extractNamespace(k, bindings); } @@ -208,7 +302,7 @@ public void attach( public void detach() { - composites.forEach((k, v) -> detach.accept(v)); + composites.forEach((k, v) -> detach.accept(v.composite)); composites.clear(); } @@ -224,8 +318,8 @@ private void attachProxyBinding( Object2ObjectHashMap::new)); namespaceGenerator.init(binding); - final NamespaceConfig composite = namespaceGenerator.generateProxy(binding, asyncapis, schemaIdsByApiId::get); - composite.readURL = binding.readURL; + final List labels = configs.stream().map(c -> c.apiLabel).collect(toList()); + final NamespaceConfig composite = namespaceGenerator.generateProxy(binding, asyncapis, schemaIdsByApiId::get, labels); attach.accept(composite); updateNamespace(configs, composite, new ArrayList<>(asyncapis.values())); } @@ -254,7 +348,6 @@ private void attachServerClientBinding( namespaceConfig.servers.forEach(s -> s.setAsyncapiProtocol( namespaceGenerator.resolveProtocol(s.protocol(), options, namespaceConfig.asyncapis, namespaceConfig.servers))); final NamespaceConfig composite = namespaceGenerator.generate(binding, namespaceConfig); - composite.readURL = binding.readURL; attach.accept(composite); updateNamespace(namespaceConfig.configs, composite, namespaceConfig.asyncapis); } @@ -267,7 +360,7 @@ private void updateNamespace( { configs.forEach(c -> { - composites.put(c.schemaId, composite); + composites.put(c.schemaId, new CompositeNamespace(composite, c.asyncapi.operations.keySet())); schemaIdsByApiId.put(c.apiLabel, c.schemaId); }); asyncapis.forEach(this::extractChannels); @@ -290,7 +383,11 @@ private void extractResolveId( int schemaId, List bindings) { - bindings.forEach(b -> compositeResolvedIds.put(schemaId, b.id)); + bindings.forEach(b -> + { + String operationType = b.type.replace("-kafka", ""); + compositeResolvedIds.put(schemaId + operationType, b.id); + }); } private void extractOperations( @@ -300,6 +397,16 @@ private void extractOperations( { String[] refParts = v.channel.ref.split("/"); operationIds.put(refParts[refParts.length - 1], k); + if (SEND_OPERATION.equals(v.action)) + { + sendOperationIds.put(refParts[refParts.length - 1], k); + } + else if (RECEIVE_OPERATION.equals(v.action)) + { + receiveOperationIds.put(refParts[refParts.length - 1], k); + } + + operationBindings.put(k, v.bindings); }); } @@ -419,4 +526,18 @@ private void visitAuthority( authority = authorityRO.wrap(value.buffer(), value.offset(), value.limit()); } } + + static class CompositeNamespace + { + NamespaceConfig composite; + Set operations; + + CompositeNamespace( + NamespaceConfig composite, + Set operations) + { + this.composite = composite; + this.operations = operations; + } + } } diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiClientNamespaceGenerator.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiClientNamespaceGenerator.java index e1f2908402..b7e44e36fc 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiClientNamespaceGenerator.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiClientNamespaceGenerator.java @@ -32,14 +32,11 @@ public NamespaceConfig generate( BindingConfig binding, AsyncapiNamespaceConfig namespaceConfig) { - List servers = namespaceConfig.servers; - AsyncapiOptionsConfig options = binding.options != null ? (AsyncapiOptionsConfig) binding.options : EMPTY_OPTION; + final List servers = namespaceConfig.servers; + final AsyncapiOptionsConfig options = binding.options != null ? (AsyncapiOptionsConfig) binding.options : EMPTY_OPTION; final List metricRefs = binding.telemetryRef != null ? binding.telemetryRef.metricRefs : emptyList(); - //TODO: keep it until we support different protocols on the same composite binding - AsyncapiServerView serverView = servers.get(0); - this.protocol = serverView.getAsyncapiProtocol(); int[] compositeSecurePorts = resolvePorts(servers, true); this.isTlsEnabled = compositeSecurePorts.length > 0; @@ -48,24 +45,70 @@ public NamespaceConfig generate( .name(String.format("%s.%s-%s", qname, "$composite", namespace)) .inject(n -> this.injectNamespaceMetric(n, !metricRefs.isEmpty())) .inject(n -> this.injectCatalog(n, namespaceConfig.asyncapis)) - .inject(n -> protocol.injectProtocolClientCache(n, metricRefs)) - .binding() - .name(String.format("%s_client0", protocol.scheme)) - .type(protocol.scheme) - .kind(CLIENT) - .inject(b -> this.injectMetrics(b, metricRefs, protocol.scheme)) - .inject(protocol::injectProtocolClientOptions) - .exit(isTlsEnabled ? "tls_client0" : "tcp_client0") - .build() - .inject(n -> injectTlsClient(n, options, metricRefs)) + .inject(n -> this.injectProtocolClients(n, servers, metricRefs)) + .inject(n -> this.injectProtocolRelatedBindings(n, servers, metricRefs)) + .inject(n -> this.injectTlsClient(n, options, metricRefs)) + .inject(n -> this.injectTcpClient(n, servers, options, metricRefs)) + .build(); + } + + private NamespaceConfigBuilder injectTcpClient( + NamespaceConfigBuilder namespace, + List servers, + AsyncapiOptionsConfig options, + List metricRefs) + { + for (AsyncapiServerView server : servers) + { + final AsyncapiProtocol protocol = server.getAsyncapiProtocol(); + namespace = namespace .binding() .name("tcp_client0") .type("tcp") .kind(CLIENT) - .inject(b -> this.injectMetrics(b, metricRefs, "tcp")) + .inject(b -> this.injectMetrics(b, metricRefs)) .options(!protocol.scheme.equals(AyncapiKafkaProtocol.SCHEME) ? options.tcp : null) - .build() .build(); + } + + return namespace; + } + + private NamespaceConfigBuilder injectProtocolClients( + NamespaceConfigBuilder namespace, + List servers, + List metricRefs) + { + for (AsyncapiServerView server : servers) + { + final AsyncapiProtocol protocol = server.getAsyncapiProtocol(); + final String scheme = protocol.scheme; + final String exit = "sse".equals(scheme) ? "http_client0" : isTlsEnabled ? "tls_client0" : "tcp_client0"; + namespace = namespace + .inject(n -> protocol.injectProtocolClientCache(n, metricRefs)) + .binding() + .name(String.format("%s_client0", scheme)) + .type(scheme) + .kind(CLIENT) + .inject(b -> this.injectMetrics(b, metricRefs)) + .inject(protocol::injectProtocolClientOptions) + .exit(exit) + .build(); + } + return namespace; + } + + protected NamespaceConfigBuilder injectProtocolRelatedBindings( + NamespaceConfigBuilder namespace, + List servers, + List metricRefs) + { + for (AsyncapiServerView server : servers) + { + final AsyncapiProtocol protocol = server.getAsyncapiProtocol(); + namespace = protocol.injectProtocolRelatedClientBindings(namespace, metricRefs, isTlsEnabled); + } + return namespace; } private NamespaceConfigBuilder injectTlsClient( @@ -80,7 +123,7 @@ private NamespaceConfigBuilder injectTlsClient( .name("tls_client0") .type("tls") .kind(CLIENT) - .inject(b -> this.injectMetrics(b, metricRefs, "tls")) + .inject(b -> this.injectMetrics(b, metricRefs)) .options(options.tls) .vault(String.format("%s:%s", this.namespace, vault)) .exit("tcp_client0") diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiConditionConfigAdapter.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiConditionConfigAdapter.java index 8d659d7141..cc3e31656c 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiConditionConfigAdapter.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiConditionConfigAdapter.java @@ -42,8 +42,11 @@ public JsonObject adaptToJson( JsonObjectBuilder object = Json.createObjectBuilder(); object.add(API_ID_NAME, asyncapiCondition.apiId); - object.add(OPERATION_ID_NAME, asyncapiCondition.operationId); + if (asyncapiCondition.operationId != null) + { + object.add(OPERATION_ID_NAME, asyncapiCondition.operationId); + } return object.build(); } @@ -51,8 +54,14 @@ public JsonObject adaptToJson( public ConditionConfig adaptFromJson( JsonObject object) { - String apiId = object.getString(API_ID_NAME); - String operationId = object.getString(OPERATION_ID_NAME); + String apiId = object.containsKey(API_ID_NAME) + ? object.getString(API_ID_NAME) + : null; + + String operationId = object.containsKey(OPERATION_ID_NAME) + ? object.getString(OPERATION_ID_NAME) + : null; + return new AsyncapiConditionConfig(apiId, operationId); } } diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiHttpKafkaProxy.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiHttpKafkaProxy.java new file mode 100644 index 0000000000..485d4aa746 --- /dev/null +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiHttpKafkaProxy.java @@ -0,0 +1,346 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.binding.asyncapi.internal.config; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import io.aklivity.zilla.runtime.binding.asyncapi.config.AsyncapiOptionsConfig; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.Asyncapi; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiChannel; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiMessage; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiOperation; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiReply; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.view.AsyncapiChannelView; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.view.AsyncapiCorrelationIdView; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.view.AsyncapiMessageView; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.view.AsyncapiSchemaView; +import io.aklivity.zilla.runtime.binding.http.kafka.config.HttpKafkaConditionConfig; +import io.aklivity.zilla.runtime.binding.http.kafka.config.HttpKafkaWithConfig; +import io.aklivity.zilla.runtime.binding.http.kafka.config.HttpKafkaWithConfigBuilder; +import io.aklivity.zilla.runtime.binding.http.kafka.config.HttpKafkaWithFetchConfig; +import io.aklivity.zilla.runtime.binding.http.kafka.config.HttpKafkaWithFetchConfigBuilder; +import io.aklivity.zilla.runtime.binding.http.kafka.config.HttpKafkaWithFetchFilterConfig; +import io.aklivity.zilla.runtime.binding.http.kafka.config.HttpKafkaWithFetchMergeConfig; +import io.aklivity.zilla.runtime.binding.http.kafka.config.HttpKafkaWithProduceAsyncHeaderConfig; +import io.aklivity.zilla.runtime.binding.http.kafka.config.HttpKafkaWithProduceConfig; +import io.aklivity.zilla.runtime.binding.http.kafka.config.HttpKafkaWithProduceConfigBuilder; +import io.aklivity.zilla.runtime.engine.config.BindingConfigBuilder; +import io.aklivity.zilla.runtime.engine.config.RouteConfigBuilder; + +public class AsyncapiHttpKafkaProxy extends AsyncapiProxy +{ + private static final String CORRELATION_ID = "\\{correlationId\\}"; + private static final String PARAMETERS = "\\{(?!correlationId)(\\w+)\\}"; + private static final String HEADER_LOCATION = "([^/]+)$"; + private static final String ASYNCAPI_KAFKA_PROTOCOL_NAME = "kafka"; + private static final String ASYNCAPI_HTTP_PROTOCOL_NAME = "http"; + private static final String ASYNCAPI_SEND_ACTION_NAME = "send"; + private static final String ASYNCAPI_RECEIVE_ACTION_NAME = "receive"; + private static final Pattern PARAMETER_PATTERN = Pattern.compile("\\{([^}]+)\\}"); + private static final Pattern HEADER_LOCATION_PATTERN = Pattern.compile(HEADER_LOCATION); + + private final Matcher parameters = PARAMETER_PATTERN.matcher(""); + private final Matcher headerLocation = HEADER_LOCATION_PATTERN.matcher(""); + + protected AsyncapiHttpKafkaProxy( + String qname, + Map asyncapis) + { + super("http-kafka", qname, asyncapis); + } + + @Override + protected BindingConfigBuilder injectProxyRoutes( + BindingConfigBuilder binding, + List routes) + { + inject: + for (AsyncapiRouteConfig route : routes) + { + final Asyncapi kafkaAsyncapi = asyncapis.get(route.with.apiId); + + for (AsyncapiConditionConfig condition : route.when) + { + final Asyncapi httpAsyncapi = asyncapis.get(condition.apiId); + if (httpAsyncapi.servers.values().stream().noneMatch(s -> s.protocol.startsWith(ASYNCAPI_HTTP_PROTOCOL_NAME))) + { + break inject; + } + final AsyncapiOperation whenOperation = httpAsyncapi.operations.get(condition.operationId); + if (whenOperation == null) + { + for (Map.Entry e : httpAsyncapi.operations.entrySet()) + { + AsyncapiOperation withOperation = route.with.operationId != null ? + kafkaAsyncapi.operations.get(route.with.operationId) : kafkaAsyncapi.operations.get(e.getKey()); + if (withOperation != null) + { + binding = addHttpKafkaRoute(binding, kafkaAsyncapi, httpAsyncapi, e.getValue(), withOperation); + } + } + } + else + { + AsyncapiOperation withOperation = kafkaAsyncapi.operations.get(route.with.operationId); + binding = addHttpKafkaRoute(binding, kafkaAsyncapi, httpAsyncapi, whenOperation, withOperation); + } + } + } + return binding; + } + + private BindingConfigBuilder addHttpKafkaRoute( + BindingConfigBuilder binding, + Asyncapi kafkaAsyncapi, + Asyncapi httpAsyncapi, + AsyncapiOperation whenOperation, + AsyncapiOperation withOperation) + { + + final AsyncapiChannelView channel = AsyncapiChannelView.of(httpAsyncapi.channels, whenOperation.channel); + String path = channel.address(); + if (whenOperation.bindings != null) + { + String method = whenOperation.bindings.get("http").method; + final List paramNames = findParams(path); + + AsyncapiChannelView httpChannel = AsyncapiChannelView.of(httpAsyncapi.channels, whenOperation.channel); + + boolean async = httpChannel.messages().values() + .stream().anyMatch(asyncapiMessage -> + { + AsyncapiMessageView message = + AsyncapiMessageView.of(httpAsyncapi.components.messages, asyncapiMessage); + return message.correlationId() != null; + }); + + if (async) + { + for (AsyncapiOperation operation : httpAsyncapi.operations.values()) + { + AsyncapiChannelView channelView = AsyncapiChannelView.of(httpAsyncapi.channels, operation.channel); + if (parameters.reset(channelView.address()).find()) + { + AsyncapiReply reply = withOperation.reply; + if (reply != null) + { + final RouteConfigBuilder> asyncRouteBuilder = binding.route(); + binding = addAsyncOperation(asyncRouteBuilder, httpAsyncapi, kafkaAsyncapi, operation, + withOperation); + } + } + } + } + + final RouteConfigBuilder> routeBuilder = binding.route(); + routeBuilder + .exit(qname) + .when(HttpKafkaConditionConfig::builder) + .method(method) + .path(path) + .build() + .inject(r -> injectHttpKafkaRouteWith(r, httpAsyncapi, kafkaAsyncapi, whenOperation, + withOperation, paramNames)); + binding = routeBuilder.build(); + } + return binding; + } + + private BindingConfigBuilder addAsyncOperation( + RouteConfigBuilder> routeBuilder, + Asyncapi httpAsyncapi, + Asyncapi kafkaAsyncapi, + AsyncapiOperation httpOperation, + AsyncapiOperation kafkaOperation) + { + final AsyncapiChannelView channel = AsyncapiChannelView.of(httpAsyncapi.channels, httpOperation.channel); + String path = channel.address(); + String method = httpOperation.bindings.get("http").method; + final List paramNames = findParams(path); + return routeBuilder + .exit(qname) + .when(HttpKafkaConditionConfig::builder) + .method(method) + .path(path) + .build() + .inject(r -> injectAsyncProduceHttpKafkaRouteWith(r, httpAsyncapi, kafkaAsyncapi, httpOperation, + kafkaOperation, paramNames)) + .build(); + } + + @Override + public BindingConfigBuilder injectProxyOptions( + BindingConfigBuilder binding, + AsyncapiOptionsConfig options) + { + return binding; + } + + private List findParams( + String item) + { + List paramNames = new ArrayList<>(); + Matcher matcher = parameters.reset(item); + while (matcher.find()) + { + paramNames.add(parameters.group(1)); + } + return paramNames; + } + + private RouteConfigBuilder injectHttpKafkaRouteWith( + RouteConfigBuilder route, + Asyncapi httpAsyncapi, + Asyncapi kafkaAsyncapi, + AsyncapiOperation httpOperation, + AsyncapiOperation kafkaOperation, + List paramNames) + { + final HttpKafkaWithConfigBuilder newWith = HttpKafkaWithConfig.builder(); + final AsyncapiChannelView channel = AsyncapiChannelView + .of(kafkaAsyncapi.channels, kafkaOperation.channel); + final String topic = channel.address(); + + switch (kafkaOperation.action) + { + case "receive": + newWith.fetch(HttpKafkaWithFetchConfig.builder() + .topic(topic) + .inject(with -> injectHttpKafkaRouteFetchWith(with, httpAsyncapi, httpOperation, paramNames)) + .build()); + break; + case "send": + newWith.produce(HttpKafkaWithProduceConfig.builder() + .topic(topic) + .inject(w -> injectHttpKafkaRouteProduceWith(w, httpOperation, kafkaOperation, httpAsyncapi, + kafkaAsyncapi.channels, paramNames)) + .build()); + break; + } + + route.with(newWith.build()); + + return route; + } + + private RouteConfigBuilder injectAsyncProduceHttpKafkaRouteWith( + RouteConfigBuilder route, + Asyncapi httpAsyncapi, + Asyncapi kafkaAsyncapi, + AsyncapiOperation httpOperation, + AsyncapiOperation kafkaOperation, + List paramNames) + { + final HttpKafkaWithConfigBuilder newWith = HttpKafkaWithConfig.builder(); + final AsyncapiChannelView channel = AsyncapiChannelView.of(kafkaAsyncapi.channels, kafkaOperation.channel); + final String topic = channel.address(); + + newWith.produce(HttpKafkaWithProduceConfig.builder() + .topic(topic) + .inject(w -> injectHttpKafkaRouteProduceWith(w, httpOperation, kafkaOperation, httpAsyncapi, + kafkaAsyncapi.channels, paramNames)) + .build()); + route.with(newWith.build()); + + return route; + } + + private HttpKafkaWithFetchConfigBuilder injectHttpKafkaRouteFetchWith( + HttpKafkaWithFetchConfigBuilder fetch, + Asyncapi httpAsyncapi, + AsyncapiOperation httpOperation, + List paramNames) + { + final AsyncapiChannelView channel = AsyncapiChannelView.of(httpAsyncapi.channels, httpOperation.channel); + merge: + for (Map.Entry message : channel.messages().entrySet()) + { + AsyncapiMessageView messageView = AsyncapiMessageView.of(httpAsyncapi.components.messages, message.getValue()); + AsyncapiSchemaView schema = AsyncapiSchemaView.of(httpAsyncapi.components.schemas, messageView.payload()); + + if (schema != null && "array".equals(schema.getType())) + { + fetch.merged(HttpKafkaWithFetchMergeConfig.builder() + .contentType("application/json") + .initial("[]") + .path("/-") + .build()); + break merge; + } + } + + if (!paramNames.isEmpty()) + { + fetch.filters(List.of(HttpKafkaWithFetchFilterConfig.builder() + .key(String.format("${params.%s}", paramNames.get(paramNames.size() - 1))) + .build())); + } + + return fetch; + } + + private HttpKafkaWithProduceConfigBuilder injectHttpKafkaRouteProduceWith( + HttpKafkaWithProduceConfigBuilder produce, + AsyncapiOperation httpOperation, + AsyncapiOperation kafkaOperation, + Asyncapi httpAsyncapi, + Map kafkaChannels, + List paramNames) + { + final String key = !paramNames.isEmpty() ? String.format("${params.%s}", + paramNames.get(paramNames.size() - 1)) : "${idempotencyKey}"; + + produce.acks("in_sync_replicas").key(key); + + AsyncapiChannelView httpChannel = AsyncapiChannelView.of(httpAsyncapi.channels, httpOperation.channel); + + httpChannel.messages().values() + .forEach(asyncapiMessage -> + { + AsyncapiMessageView message = AsyncapiMessageView.of(httpAsyncapi.components.messages, asyncapiMessage); + if (message.correlationId() != null) + { + AsyncapiCorrelationIdView correlationId = + AsyncapiCorrelationIdView.of(httpAsyncapi.components.correlationIds, message.correlationId()); + if (headerLocation.reset(correlationId.location()).find()) + { + String headerName = headerLocation.group(1); + String location = message.headers().properties.get(headerName).format; + location = location.replaceAll(CORRELATION_ID, "\\${correlationId}"); + location = location.replaceAll(PARAMETERS, "\\${params.$1}"); + produce.async(HttpKafkaWithProduceAsyncHeaderConfig.builder() + .name("location") + .value(location) + .build()); + } + } + }); + + AsyncapiReply reply = kafkaOperation.reply; + if (reply != null) + { + AsyncapiChannelView channel = AsyncapiChannelView.of(kafkaChannels, reply.channel); + produce.replyTo(channel.address()); + } + + produce.build(); + + return produce; + } +} diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiHttpProtocol.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiHttpProtocol.java index 5f959d2628..39e8e5fa57 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiHttpProtocol.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiHttpProtocol.java @@ -22,6 +22,7 @@ import io.aklivity.zilla.runtime.binding.asyncapi.config.AsyncapiOptionsConfig; import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.Asyncapi; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiBinding; import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiMessage; import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiOperation; import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiParameter; @@ -107,21 +108,50 @@ public BindingConfigBuilder injectProtocolServerRoutes( for (Map.Entry entry : asyncapi.servers.entrySet()) { AsyncapiServerView server = AsyncapiServerView.of(entry.getValue()); - for (String name : asyncapi.operations.keySet()) + if ("http".equals(server.protocol())) { - AsyncapiOperation operation = asyncapi.operations.get(name); - AsyncapiChannelView channel = AsyncapiChannelView.of(asyncapi.channels, operation.channel); - String path = channel.address().replaceAll("\\{[^}]+\\}", "*"); - String method = operation.bindings.get("http").method; - binding - .route() - .exit(qname) - .when(HttpConditionConfig::builder) - .header(":path", path) - .header(":method", method) - .build() - .inject(route -> injectHttpServerRouteGuarded(route, server)) - .build(); + for (String name : asyncapi.operations.keySet()) + { + AsyncapiOperation operation = asyncapi.operations.get(name); + AsyncapiChannelView channel = AsyncapiChannelView.of(asyncapi.channels, operation.channel); + String path = channel.address().replaceAll("\\{[^}]+\\}", "*"); + if (operation.bindings != null) + { + AsyncapiBinding httpBinding = operation.bindings.get("http"); + if (httpBinding != null) + { + String method = httpBinding.method; + binding + .route() + .exit(qname) + .when(HttpConditionConfig::builder) + .header(":path", path) + .header(":method", method) + .build() + .inject(route -> injectHttpServerRouteGuarded(route, server)) + .build(); + } + } + } + } + else if ("sse".equals(server.protocol())) + { + for (String name : asyncapi.operations.keySet()) + { + AsyncapiOperation operation = asyncapi.operations.get(name); + if (operation.bindings == null) + { + AsyncapiChannelView channel = AsyncapiChannelView.of(asyncapi.channels, operation.channel); + String path = channel.address().replaceAll("\\{[^}]+\\}", "*"); + binding + .route() + .exit("sse_server0") + .when(HttpConditionConfig::builder) + .header(":path", path) + .build() + .build(); + } + } } } } @@ -154,10 +184,11 @@ private HttpOptionsConfigBuilder injectHttpServerRequests( AsyncapiOperation operation = asyncapi.operations.get(name); AsyncapiChannelView channel = AsyncapiChannelView.of(asyncapi.channels, operation.channel); String path = channel.address(); - Method method = Method.valueOf(operation.bindings.get("http").method); - if (channel.messages() != null && !channel.messages().isEmpty() || + + if (operation.bindings != null && channel.messages() != null && !channel.messages().isEmpty() || channel.parameters() != null && !channel.parameters().isEmpty()) { + Method method = Method.valueOf(operation.bindings.get("http").method); options .request() .path(path) diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiMqttKafkaProxy.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiMqttKafkaProxy.java new file mode 100644 index 0000000000..f069d12eae --- /dev/null +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiMqttKafkaProxy.java @@ -0,0 +1,128 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.binding.asyncapi.internal.config; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import io.aklivity.zilla.runtime.binding.asyncapi.config.AsyncapiOptionsConfig; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.Asyncapi; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiOperation; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.MqttQoS; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.view.AsyncapiChannelView; +import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaConditionConfig; +import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaConditionKind; +import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaOptionsConfig; +import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaWithConfig; +import io.aklivity.zilla.runtime.engine.config.BindingConfigBuilder; +import io.aklivity.zilla.runtime.engine.config.RouteConfigBuilder; + +public class AsyncapiMqttKafkaProxy extends AsyncapiProxy +{ + private static final String ASYNCAPI_KAFKA_PROTOCOL_NAME = "kafka"; + private static final String ASYNCAPI_MQTT_PROTOCOL_NAME = "mqtt"; + private static final String ASYNCAPI_SEND_ACTION_NAME = "send"; + private static final String ASYNCAPI_RECEIVE_ACTION_NAME = "receive"; + + protected AsyncapiMqttKafkaProxy( + String qname, + Map asyncapis) + { + super("mqtt-kafka", qname, asyncapis); + } + + @Override + protected BindingConfigBuilder injectProxyRoutes( + BindingConfigBuilder binding, + List routes) + { + inject: + for (AsyncapiRouteConfig route : routes) + { + final RouteConfigBuilder> routeBuilder = binding.route(); + + final Asyncapi kafkaAsyncapi = asyncapis.get(route.with.apiId); + + final AsyncapiOperation withOperation = kafkaAsyncapi.operations.get(route.with.operationId); + final String messages = AsyncapiChannelView.of(kafkaAsyncapi.channels, withOperation.channel).address(); + + for (AsyncapiConditionConfig condition : route.when) + { + final Asyncapi mqttAsyncapi = asyncapis.get(condition.apiId); + if (mqttAsyncapi.servers.values().stream().noneMatch(s -> s.protocol.startsWith(ASYNCAPI_MQTT_PROTOCOL_NAME))) + { + break inject; + } + final AsyncapiOperation whenOperation = mqttAsyncapi.operations.get(condition.operationId); + final AsyncapiChannelView channel = AsyncapiChannelView.of(mqttAsyncapi.channels, whenOperation.channel); + final MqttKafkaConditionKind kind = whenOperation.action.equals(ASYNCAPI_SEND_ACTION_NAME) ? + MqttKafkaConditionKind.PUBLISH : MqttKafkaConditionKind.SUBSCRIBE; + String topic = channel.address(); + + routeBuilder + .when(MqttKafkaConditionConfig::builder) + .topic(topic) + .kind(kind) + .build() + .with(MqttKafkaWithConfig::builder) + .messages(messages.replaceAll("\\{([^{}]*)\\}", "\\${params.$1}")) + .build() + .exit(qname); + } + binding = routeBuilder.build(); + } + return binding; + } + + @Override + public BindingConfigBuilder injectProxyOptions( + BindingConfigBuilder binding, + AsyncapiOptionsConfig options) + { + String sessions = ""; + String messages = ""; + String retained = ""; + for (Asyncapi asyncapi : asyncapis.values()) + { + if (asyncapi.channels.containsKey(options.mqttKafka.channels.sessions)) + { + sessions = asyncapi.channels.get(options.mqttKafka.channels.sessions).address; + } + + if (asyncapi.channels.containsKey(options.mqttKafka.channels.messages)) + { + messages = asyncapi.channels.get(options.mqttKafka.channels.messages).address; + } + + if (asyncapi.channels.containsKey(options.mqttKafka.channels.retained)) + { + retained = asyncapi.channels.get(options.mqttKafka.channels.retained).address; + } + } + return binding + .options(MqttKafkaOptionsConfig::builder) + .topics() + .sessions(sessions) + .messages(messages) + .retained(retained) + .build() + .publish() + .qosMax(MqttQoS.EXACTLY_ONCE.name().toLowerCase()) + .build() + .clients(Collections.emptyList()) + .build(); + } +} diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiNamespaceGenerator.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiNamespaceGenerator.java index ddf75ede2c..9cf08a0de7 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiNamespaceGenerator.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiNamespaceGenerator.java @@ -16,6 +16,7 @@ import static com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature.MINIMIZE_QUOTES; import static com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature.WRITE_DOC_START_MARKER; +import static io.aklivity.zilla.runtime.common.feature.FeatureFilter.featureEnabled; import static java.util.stream.Collectors.toList; import static org.agrona.LangUtil.rethrowUnchecked; @@ -67,7 +68,6 @@ public abstract class AsyncapiNamespaceGenerator protected Map asyncapis; protected boolean isTlsEnabled; - protected AsyncapiProtocol protocol; protected String qname; protected String namespace; protected String qvault; @@ -92,7 +92,8 @@ public NamespaceConfig generate( public NamespaceConfig generateProxy( BindingConfig binding, Map asyncapis, - ToLongFunction resolveApiId) + ToLongFunction resolveApiId, + List labels) { return null; } @@ -103,7 +104,7 @@ protected AsyncapiProtocol resolveProtocol( List asyncapis, List servers) { - Pattern pattern = Pattern.compile("(http|mqtt|kafka)"); + Pattern pattern = Pattern.compile("(http|sse|mqtt|kafka)"); Matcher matcher = pattern.matcher(protocolName); AsyncapiProtocol protocol = null; if (matcher.find()) @@ -113,6 +114,14 @@ protected AsyncapiProtocol resolveProtocol( case "http": protocol = new AsyncapiHttpProtocol(qname, asyncapis, options, protocolName); break; + case "sse": + case "secure-sse": + if (featureEnabled(AsyncapiSseProtocol.class)) + { + final boolean httpServerAvailable = servers.stream().anyMatch(s -> "http".equals(s.protocol())); + protocol = new AsyncapiSseProtocol(qname, httpServerAvailable, asyncapis, options, protocolName); + } + break; case "mqtt": protocol = new AsyncapiMqttProtocol(qname, asyncapis, options, protocolName, namespace); break; @@ -186,6 +195,20 @@ public int[] resolvePorts( return ports; } + public int[] resolvePortForServer( + AsyncapiServerView server, + boolean secure) + { + int[] ports = {}; + + if (server.getAsyncapiProtocol().isSecure() == secure) + { + ports = new int[] { server.getPort() }; + } + + return ports; + } + protected NamespaceConfigBuilder injectCatalog( NamespaceConfigBuilder namespace, List asyncapis) @@ -275,8 +298,7 @@ protected static String writeSchemaYaml( protected BindingConfigBuilder injectMetrics( BindingConfigBuilder binding, - List metricRefs, - String protocol) + List metricRefs) { List metrics = metricRefs.stream() .filter(m -> m.name.startsWith("stream.")) diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiProtocol.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiProtocol.java index 4c9a60f1bb..298886736a 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiProtocol.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiProtocol.java @@ -45,6 +45,7 @@ public abstract class AsyncapiProtocol protected Map securitySchemes; protected boolean isJwtEnabled; public final String scheme; + public final String tcpRoute; public final String protocol; protected AsyncapiProtocol( @@ -52,15 +53,41 @@ protected AsyncapiProtocol( List asyncapis, String protocol, String scheme) + { + this(qname, asyncapis, protocol, scheme, scheme); + } + + protected AsyncapiProtocol( + String qname, + List asyncapis, + String protocol, + String scheme, + String tcpRoute) { this.qname = qname; this.asyncapis = asyncapis; this.protocol = protocol; this.scheme = scheme; + this.tcpRoute = tcpRoute; this.securitySchemes = resolveSecuritySchemes(); this.isJwtEnabled = !securitySchemes.isEmpty(); } + public NamespaceConfigBuilder injectProtocolRelatedServerBindings( + NamespaceConfigBuilder namespace, + List metricRefs) + { + return namespace; + } + + public NamespaceConfigBuilder injectProtocolRelatedClientBindings( + NamespaceConfigBuilder namespace, + List metricRefs, + boolean isTlsEnabled) + { + return namespace; + } + public abstract BindingConfigBuilder injectProtocolServerOptions( BindingConfigBuilder binding); @@ -153,8 +180,7 @@ protected Map resolveSecuritySchemes() protected BindingConfigBuilder injectMetrics( BindingConfigBuilder binding, - List metricRefs, - String protocol) + List metricRefs) { if (metricRefs != null && !metricRefs.isEmpty()) { diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiProxy.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiProxy.java new file mode 100644 index 0000000000..728e25f05b --- /dev/null +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiProxy.java @@ -0,0 +1,47 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.binding.asyncapi.internal.config; + +import java.util.List; +import java.util.Map; + +import io.aklivity.zilla.runtime.binding.asyncapi.config.AsyncapiOptionsConfig; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.Asyncapi; +import io.aklivity.zilla.runtime.engine.config.BindingConfigBuilder; + +public abstract class AsyncapiProxy +{ + protected final String type; + protected final String qname; + protected final Map asyncapis; + + protected AsyncapiProxy( + String type, + String qname, + Map asyncapis) + { + this.type = type; + this.qname = qname; + this.asyncapis = asyncapis; + } + + protected abstract BindingConfigBuilder injectProxyRoutes( + BindingConfigBuilder binding, + List routes); + + public abstract BindingConfigBuilder injectProxyOptions( + BindingConfigBuilder binding, + AsyncapiOptionsConfig options); +} diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiProxyNamespaceGenerator.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiProxyNamespaceGenerator.java index 79cb502d77..cb70410dee 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiProxyNamespaceGenerator.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiProxyNamespaceGenerator.java @@ -17,37 +17,34 @@ import static io.aklivity.zilla.runtime.engine.config.KindConfig.PROXY; import static java.util.Collections.emptyList; -import java.util.Collections; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.function.ToLongFunction; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; import io.aklivity.zilla.runtime.binding.asyncapi.config.AsyncapiOptionsConfig; import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.Asyncapi; -import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiOperation; -import io.aklivity.zilla.runtime.binding.asyncapi.internal.view.AsyncapiChannelView; -import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaConditionConfig; -import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaConditionKind; -import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaOptionsConfig; -import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaWithConfig; import io.aklivity.zilla.runtime.engine.config.BindingConfig; -import io.aklivity.zilla.runtime.engine.config.BindingConfigBuilder; import io.aklivity.zilla.runtime.engine.config.MetricRefConfig; import io.aklivity.zilla.runtime.engine.config.NamespaceConfig; -import io.aklivity.zilla.runtime.engine.config.RouteConfigBuilder; +import io.aklivity.zilla.runtime.engine.config.NamespaceConfigBuilder; public class AsyncapiProxyNamespaceGenerator extends AsyncapiNamespaceGenerator { - private static final String ASYNCAPI_SEND_ACTION_NAME = "send"; - private static final String ASYNCAPI_RECEIVE_ACTION_NAME = "receive"; private static final String ASYNCAPI_KAFKA_PROTOCOL_NAME = "kafka"; private static final String ASYNCAPI_MQTT_PROTOCOL_NAME = "mqtt"; + private static final String ASYNCAPI_HTTP_PROTOCOL_NAME = "http"; + private static final String ASYNCAPI_SSE_PROTOCOL_NAME = "sse"; public NamespaceConfig generateProxy( BindingConfig binding, Map asyncapis, - ToLongFunction resolveApiId) + ToLongFunction resolveApiId, + List labels) { AsyncapiOptionsConfig options = binding.options != null ? (AsyncapiOptionsConfig) binding.options : EMPTY_OPTION; List routes = binding.routes.stream() @@ -58,92 +55,76 @@ public NamespaceConfig generateProxy( final List metricRefs = binding.telemetryRef != null ? binding.telemetryRef.metricRefs : emptyList(); - String sessions = ""; - String messages = ""; - String retained = ""; - for (Asyncapi asyncapi : asyncapis.values()) - { - if (asyncapi.channels.containsKey(options.mqttKafka.channels.sessions)) - { - sessions = asyncapi.channels.get(options.mqttKafka.channels.sessions).address; - } - - if (asyncapi.channels.containsKey(options.mqttKafka.channels.messages)) - { - messages = asyncapi.channels.get(options.mqttKafka.channels.messages).address; - } + final Map> routesByProtocol = new HashMap<>(); - if (asyncapi.channels.containsKey(options.mqttKafka.channels.retained)) - { - retained = asyncapi.channels.get(options.mqttKafka.channels.retained).address; - } - } - - return NamespaceConfig.builder() - .name(String.format("%s/%s", qname, "mqtt-kafka")) - .inject(n -> this.injectNamespaceMetric(n, !metricRefs.isEmpty())) - .binding() - .name("mqtt_kafka_proxy0") - .type("mqtt-kafka") - .kind(PROXY) - .inject(b -> this.injectMetrics(b, metricRefs, "mqtt-kafka")) - .options(MqttKafkaOptionsConfig::builder) - .topics() - .sessions(sessions) - .messages(messages) - .retained(retained) - .build() - .clients(Collections.emptyList()) - .build() - .inject(b -> this.injectMqttKafkaRoutes(b, routes)) - .build() - .build(); - } - - public BindingConfigBuilder injectMqttKafkaRoutes( - BindingConfigBuilder binding, - List routes) - { inject: for (AsyncapiRouteConfig route : routes) { - final RouteConfigBuilder> routeBuilder = binding.route(); - final Asyncapi kafkaAsyncapi = asyncapis.get(route.with.apiId); - if (kafkaAsyncapi.servers.values().stream().anyMatch(s -> !s.protocol.startsWith(ASYNCAPI_KAFKA_PROTOCOL_NAME))) { break inject; } - final AsyncapiOperation withOperation = kafkaAsyncapi.operations.get(route.with.operationId); - final String messages = AsyncapiChannelView.of(kafkaAsyncapi.channels, withOperation.channel).address(); - for (AsyncapiConditionConfig condition : route.when) { - final Asyncapi mqttAsyncapi = asyncapis.get(condition.apiId); - if (mqttAsyncapi.servers.values().stream().anyMatch(s -> !s.protocol.startsWith(ASYNCAPI_MQTT_PROTOCOL_NAME))) + final Asyncapi asyncapi = asyncapis.get(condition.apiId); + if (asyncapi.servers.values().stream().anyMatch(s -> + !s.protocol.startsWith(ASYNCAPI_MQTT_PROTOCOL_NAME) && + !s.protocol.startsWith(ASYNCAPI_HTTP_PROTOCOL_NAME) && + !s.protocol.startsWith(ASYNCAPI_SSE_PROTOCOL_NAME))) { break inject; } - final AsyncapiOperation whenOperation = mqttAsyncapi.operations.get(condition.operationId); - final AsyncapiChannelView channel = AsyncapiChannelView.of(mqttAsyncapi.channels, whenOperation.channel); - final MqttKafkaConditionKind kind = whenOperation.action.equals(ASYNCAPI_SEND_ACTION_NAME) ? - MqttKafkaConditionKind.PUBLISH : MqttKafkaConditionKind.SUBSCRIBE; - String topic = channel.address(); + asyncapi.servers.values() + .forEach(s -> routesByProtocol.computeIfAbsent(s.protocol, c -> new ArrayList<>()).add(route)); + } + } + + final String namespace = String.join("+", labels); + NamespaceConfigBuilder builder = NamespaceConfig.builder() + .name(String.format("%s/%s", qname, namespace)) + .inject(n -> this.injectNamespaceMetric(n, !metricRefs.isEmpty())); + + routesByProtocol.forEach((k, r) -> + { + final AsyncapiProxy proxy = resolveProxy(k); + builder.binding() + .name(String.format("%s_proxy0", proxy.type)) + .type(proxy.type) + .kind(PROXY) + .inject(b -> this.injectMetrics(b, metricRefs)) + .inject(b -> proxy.injectProxyOptions(b, options)) + .inject(b -> proxy.injectProxyRoutes(b, r)) + .build(); + }); - routeBuilder - .when(MqttKafkaConditionConfig::builder) - .topic(topic) - .kind(kind) - .build() - .with(MqttKafkaWithConfig::builder) - .messages(messages.replaceAll("\\{([^{}]*)\\}", "\\${params.$1}")) - .build() - .exit(qname); + + return builder.build(); + } + + private AsyncapiProxy resolveProxy( + String protocol) + { + Pattern pattern = Pattern.compile("(http|mqtt|sse)"); + Matcher matcher = pattern.matcher(protocol); + AsyncapiProxy proxy = null; + if (matcher.find()) + { + switch (matcher.group()) + { + case "http": + proxy = new AsyncapiHttpKafkaProxy(qname, asyncapis); + break; + case "sse": + proxy = new AsyncapiSseKafkaProxy(qname, asyncapis); + break; + case "mqtt": + proxy = new AsyncapiMqttKafkaProxy(qname, asyncapis); + break; } - binding = routeBuilder.build(); } - return binding; + return proxy; } + } diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiServerNamespaceGenerator.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiServerNamespaceGenerator.java index c58961015a..6fb4caac16 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiServerNamespaceGenerator.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiServerNamespaceGenerator.java @@ -23,12 +23,14 @@ import io.aklivity.zilla.runtime.binding.asyncapi.internal.view.AsyncapiServerView; import io.aklivity.zilla.runtime.binding.tcp.config.TcpConditionConfig; import io.aklivity.zilla.runtime.binding.tcp.config.TcpOptionsConfig; +import io.aklivity.zilla.runtime.binding.tls.config.TlsConditionConfig; import io.aklivity.zilla.runtime.binding.tls.config.TlsOptionsConfig; import io.aklivity.zilla.runtime.engine.config.BindingConfig; import io.aklivity.zilla.runtime.engine.config.BindingConfigBuilder; import io.aklivity.zilla.runtime.engine.config.MetricRefConfig; import io.aklivity.zilla.runtime.engine.config.NamespaceConfig; import io.aklivity.zilla.runtime.engine.config.NamespaceConfigBuilder; +import io.aklivity.zilla.runtime.engine.config.RouteConfigBuilder; public class AsyncapiServerNamespaceGenerator extends AsyncapiNamespaceGenerator { @@ -41,9 +43,6 @@ public NamespaceConfig generate( final List metricRefs = binding.telemetryRef != null ? binding.telemetryRef.metricRefs : emptyList(); - //TODO: keep it until we support different protocols on the same composite binding - AsyncapiServerView serverView = servers.get(0); - this.protocol = serverView.getAsyncapiProtocol(); final String namespace = String.join("+", namespaceConfig.asyncapiLabels); return NamespaceConfig.builder() @@ -51,16 +50,44 @@ public NamespaceConfig generate( .inject(n -> this.injectNamespaceMetric(n, !metricRefs.isEmpty())) .inject(n -> this.injectCatalog(n, namespaceConfig.asyncapis)) .inject(n -> injectTcpServer(n, servers, options, metricRefs)) - .inject(n -> injectTlsServer(n, options)) + .inject(n -> injectTlsServer(n, servers, options)) + .inject(n -> injectProtocolRelatedBindings(n, servers, metricRefs)) + .inject(n -> injectProtocolServers(n, servers, metricRefs)) + .build(); + } + + protected NamespaceConfigBuilder injectProtocolRelatedBindings( + NamespaceConfigBuilder namespace, + List servers, + List metricRefs) + { + for (AsyncapiServerView server : servers) + { + final AsyncapiProtocol protocol = server.getAsyncapiProtocol(); + namespace = protocol.injectProtocolRelatedServerBindings(namespace, metricRefs); + } + return namespace; + } + + private NamespaceConfigBuilder injectProtocolServers( + NamespaceConfigBuilder namespace, + List servers, + List metricRefs) + { + for (AsyncapiServerView server : servers) + { + final AsyncapiProtocol protocol = server.getAsyncapiProtocol(); + namespace = namespace .binding() .name(String.format("%s_server0", protocol.scheme)) .type(protocol.scheme) - .inject(b -> this.injectMetrics(b, metricRefs, protocol.scheme)) + .inject(b -> this.injectMetrics(b, metricRefs)) .kind(SERVER) - .inject(b -> protocol.injectProtocolServerOptions(b)) - .inject(b -> protocol.injectProtocolServerRoutes(b)) - .build() + .inject(protocol::injectProtocolServerOptions) + .inject(protocol::injectProtocolServerRoutes) .build(); + } + return namespace; } private NamespaceConfigBuilder injectTcpServer( @@ -70,10 +97,6 @@ private NamespaceConfigBuilder injectTcpServer( List metricRefs) { int[] allPorts = resolveAllPorts(servers); - int[] compositePorts = resolvePorts(servers, false); - int[] compositeSecurePorts = resolvePorts(servers, true); - - this.isTlsEnabled = compositeSecurePorts.length > 0; final TcpOptionsConfig tcpOption = options.tcp != null ? options.tcp : TcpOptionsConfig.builder() @@ -86,56 +109,74 @@ private NamespaceConfigBuilder injectTcpServer( .name("tcp_server0") .type("tcp") .kind(SERVER) - .inject(b -> this.injectMetrics(b, metricRefs, "tcp")) + .inject(b -> this.injectMetrics(b, metricRefs)) .options(tcpOption) - .inject(b -> this.injectPlainTcpRoute(b, compositePorts)) - .inject(b -> this.injectTlsTcpRoute(b, compositeSecurePorts, metricRefs)) + .inject(b -> this.injectPlainTcpRoute(b, servers)) + .inject(b -> this.injectTlsTcpRoute(b, servers, metricRefs)) .build(); return namespace; } - private BindingConfigBuilder injectPlainTcpRoute( + protected BindingConfigBuilder injectPlainTcpRoute( BindingConfigBuilder binding, - int[] compositePorts) + List servers) { - binding - .route() + for (AsyncapiServerView server : servers) + { + final RouteConfigBuilder> routeBuilder = binding.route(); + final AsyncapiProtocol protocol = server.getAsyncapiProtocol(); + final int[] compositePorts = new int[] { server.getPort() }; + binding = routeBuilder .when(TcpConditionConfig::builder) .ports(compositePorts) .build() - .exit(String.format("%s_server0", protocol.scheme)) - .build(); + .exit(String.format("%s_server0", protocol.tcpRoute)) + .build(); + } return binding; } private BindingConfigBuilder injectTlsTcpRoute( BindingConfigBuilder binding, - int[] compositeSecurePorts, + List servers, List metricRefs) { - if (isTlsEnabled) + for (AsyncapiServerView server : servers) { - binding - .inject(b -> this.injectMetrics(b, metricRefs, "tls")) - .route() - .when(TcpConditionConfig::builder) + final RouteConfigBuilder> routeBuilder = binding.route(); + int[] compositeSecurePorts = resolvePortForServer(server, true); + + if (compositeSecurePorts.length > 0) + { + isTlsEnabled = true; + binding = + routeBuilder + .when(TcpConditionConfig::builder) .ports(compositeSecurePorts) .build() .exit("tls_server0") .build(); + } + } + if (isTlsEnabled) + { + binding = binding + .inject(b -> this.injectMetrics(b, metricRefs)); } return binding; } private NamespaceConfigBuilder injectTlsServer( NamespaceConfigBuilder namespace, + List servers, AsyncapiOptionsConfig options) { + BindingConfigBuilder> binding = namespace.binding(); if (isTlsEnabled) { - namespace - .binding() + binding = + binding .name("tls_server0") .type("tls") .kind(SERVER) @@ -144,9 +185,21 @@ private NamespaceConfigBuilder injectTlsServer( .sni(options.tls.sni) .alpn(options.tls.alpn) .build() - .vault(String.format("%s:%s", this.namespace, vault)) + .vault(String.format("%s:%s", this.namespace, vault)); + } + for (AsyncapiServerView server : servers) + { + final RouteConfigBuilder>> routeBuilder = binding.route(); + final AsyncapiProtocol protocol = server.getAsyncapiProtocol(); + if (protocol.isSecure()) + { + routeBuilder + .when(TlsConditionConfig::builder) + .ports(new int[] { server.getPort() }) + .build() .exit(String.format("%s_server0", protocol.scheme)) .build(); + } } return namespace; } diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiSseKafkaProxy.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiSseKafkaProxy.java new file mode 100644 index 0000000000..fae1fea243 --- /dev/null +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiSseKafkaProxy.java @@ -0,0 +1,140 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.binding.asyncapi.internal.config; + +import static io.aklivity.zilla.runtime.binding.sse.kafka.config.SseKafkaWithConfig.EVENT_ID_DEFAULT; + +import java.util.List; +import java.util.Map; + +import io.aklivity.zilla.runtime.binding.asyncapi.config.AsyncapiOptionsConfig; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.Asyncapi; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiOperation; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.view.AsyncapiChannelView; +import io.aklivity.zilla.runtime.binding.sse.kafka.config.SseKafkaConditionConfig; +import io.aklivity.zilla.runtime.binding.sse.kafka.config.SseKafkaWithConfig; +import io.aklivity.zilla.runtime.binding.sse.kafka.config.SseKafkaWithConfigBuilder; +import io.aklivity.zilla.runtime.engine.config.BindingConfigBuilder; +import io.aklivity.zilla.runtime.engine.config.RouteConfigBuilder; + +public class AsyncapiSseKafkaProxy extends AsyncapiProxy +{ + private static final String ASYNCAPI_KAFKA_PROTOCOL_NAME = "kafka"; + private static final String ASYNCAPI_SSE_PROTOCOL_NAME = "sse"; + private static final String ASYNCAPI_RECEIVE_ACTION_NAME = "receive"; + + protected AsyncapiSseKafkaProxy( + String qname, + Map asyncapis) + { + super("sse-kafka", qname, asyncapis); + } + + @Override + protected BindingConfigBuilder injectProxyRoutes( + BindingConfigBuilder binding, + List routes) + { + inject: + for (AsyncapiRouteConfig route : routes) + { + final Asyncapi kafkaAsyncapi = asyncapis.get(route.with.apiId); + + for (AsyncapiConditionConfig condition : route.when) + { + final Asyncapi sseAsyncapi = asyncapis.get(condition.apiId); + if (sseAsyncapi.servers.values().stream().noneMatch(s -> s.protocol.startsWith(ASYNCAPI_SSE_PROTOCOL_NAME))) + { + break inject; + } + final AsyncapiOperation whenOperation = sseAsyncapi.operations.get(condition.operationId); + if (whenOperation == null) + { + for (Map.Entry e : sseAsyncapi.operations.entrySet()) + { + AsyncapiOperation withOperation = route.with.operationId != null ? + kafkaAsyncapi.operations.get(route.with.operationId) : kafkaAsyncapi.operations.get(e.getKey()); + if (withOperation != null) + { + binding = addSseKafkaRoute(binding, kafkaAsyncapi, sseAsyncapi, e.getValue(), withOperation); + } + } + } + else + { + AsyncapiOperation withOperation = kafkaAsyncapi.operations.get(route.with.operationId); + binding = addSseKafkaRoute(binding, kafkaAsyncapi, sseAsyncapi, whenOperation, withOperation); + } + } + } + return binding; + } + + private BindingConfigBuilder addSseKafkaRoute( + BindingConfigBuilder binding, + Asyncapi kafkaAsyncapi, + Asyncapi sseAsyncapi, + AsyncapiOperation whenOperation, + AsyncapiOperation withOperation) + { + + if (whenOperation.bindings == null) + { + final AsyncapiChannelView channel = AsyncapiChannelView.of(sseAsyncapi.channels, whenOperation.channel); + String path = channel.address(); + + final RouteConfigBuilder> routeBuilder = binding.route(); + routeBuilder + .exit(qname) + .when(SseKafkaConditionConfig::builder) + .path(path) + .build() + .inject(r -> injectSseKafkaRouteWith(r, kafkaAsyncapi, withOperation)); + binding = routeBuilder.build(); + } + return binding; + } + + @Override + public BindingConfigBuilder injectProxyOptions( + BindingConfigBuilder binding, + AsyncapiOptionsConfig options) + { + return binding; + } + + private RouteConfigBuilder injectSseKafkaRouteWith( + RouteConfigBuilder route, + Asyncapi kafkaAsyncapi, + AsyncapiOperation kafkaOperation) + { + final SseKafkaWithConfigBuilder newWith = SseKafkaWithConfig.builder(); + final AsyncapiChannelView channel = AsyncapiChannelView + .of(kafkaAsyncapi.channels, kafkaOperation.channel); + final String topic = channel.address(); + + if (ASYNCAPI_RECEIVE_ACTION_NAME.equals(kafkaOperation.action)) + { + newWith + .topic(topic) + .eventId(EVENT_ID_DEFAULT) + .build(); + } + + route.with(newWith.build()); + + return route; + } +} diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiSseProtocol.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiSseProtocol.java new file mode 100644 index 0000000000..b37dd34751 --- /dev/null +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AsyncapiSseProtocol.java @@ -0,0 +1,172 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.binding.asyncapi.internal.config; + +import static io.aklivity.zilla.runtime.binding.asyncapi.internal.config.AsyncapiNamespaceGenerator.APPLICATION_JSON; +import static io.aklivity.zilla.runtime.engine.config.KindConfig.CLIENT; +import static io.aklivity.zilla.runtime.engine.config.KindConfig.SERVER; + +import java.util.List; +import java.util.Map; + +import io.aklivity.zilla.runtime.binding.asyncapi.config.AsyncapiOptionsConfig; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.Asyncapi; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiChannel; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiMessage; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiOperation; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.view.AsyncapiChannelView; +import io.aklivity.zilla.runtime.binding.sse.config.SseConditionConfig; +import io.aklivity.zilla.runtime.binding.sse.config.SseOptionsConfig; +import io.aklivity.zilla.runtime.binding.sse.config.SseOptionsConfigBuilder; +import io.aklivity.zilla.runtime.common.feature.Incubating; +import io.aklivity.zilla.runtime.engine.config.BindingConfigBuilder; +import io.aklivity.zilla.runtime.engine.config.MetricRefConfig; +import io.aklivity.zilla.runtime.engine.config.NamespaceConfigBuilder; +import io.aklivity.zilla.runtime.model.json.config.JsonModelConfig; + +@Incubating +public class AsyncapiSseProtocol extends AsyncapiProtocol +{ + private static final String SCHEME = "sse"; + private static final String SECURE_PROTOCOL = "secure-sse"; + + private final boolean httpServerAvailable; + private final AsyncapiOptionsConfig options; + + protected AsyncapiSseProtocol( + String qname, + boolean httpServerAvailable, + List asyncapis, + AsyncapiOptionsConfig options, + String protocol) + { + super(qname, asyncapis, protocol, SCHEME, "http"); + this.httpServerAvailable = httpServerAvailable; + this.options = options; + } + + @Override + public NamespaceConfigBuilder injectProtocolRelatedServerBindings( + NamespaceConfigBuilder namespace, + List metricRefs) + { + if (!httpServerAvailable) + { + final AsyncapiProtocol httpProtocol = new AsyncapiHttpProtocol(qname, asyncapis, options, "http"); + + namespace + .binding() + .name(String.format("%s_server0", httpProtocol.scheme)) + .type(httpProtocol.scheme) + .inject(b -> this.injectMetrics(b, metricRefs)) + .kind(SERVER) + .inject(httpProtocol::injectProtocolServerOptions) + .inject(httpProtocol::injectProtocolServerRoutes) + .build(); + } + return namespace; + } + + @Override + public BindingConfigBuilder injectProtocolServerOptions( + BindingConfigBuilder binding) + { + binding + .options(SseOptionsConfig::builder) + .inject(this::injectSsePathsOptions) + .build(); + return binding; + } + + @Override + public BindingConfigBuilder injectProtocolServerRoutes( + BindingConfigBuilder binding) + { + for (Asyncapi asyncapi : asyncapis) + { + for (String name : asyncapi.operations.keySet()) + { + AsyncapiOperation operation = asyncapi.operations.get(name); + if (operation.bindings == null) + { + AsyncapiChannelView channel = AsyncapiChannelView.of(asyncapi.channels, operation.channel); + String path = channel.address().replaceAll("\\{[^}]+\\}", "*"); + binding + .route() + .exit(qname) + .when(SseConditionConfig::builder) + .path(path) + .build() + .build(); + } + } + } + return binding; + } + + @Override + public NamespaceConfigBuilder injectProtocolRelatedClientBindings( + NamespaceConfigBuilder namespace, + List metricRefs, + boolean isTlsEnabled) + { + if (!httpServerAvailable) + { + namespace + .binding() + .name(String.format("%s_client0", "http")) + .type("http") + .kind(CLIENT) + .inject(b -> this.injectMetrics(b, metricRefs)) + .exit(isTlsEnabled ? "tls_client0" : "tcp_client0") + .build(); + } + return namespace; + } + + @Override + protected boolean isSecure() + { + return protocol.equals(SECURE_PROTOCOL); + } + + + private SseOptionsConfigBuilder injectSsePathsOptions( + SseOptionsConfigBuilder options) + { + for (Asyncapi asyncapi : asyncapis) + { + for (Map.Entry channelEntry : asyncapi.channels.entrySet()) + { + String path = channelEntry.getValue().address.replaceAll("\\{[^}]+\\}", "*"); + Map messages = channelEntry.getValue().messages; + if (hasJsonContentType(asyncapi)) + { + options + .request() + .path(path) + .content(JsonModelConfig::builder) + .catalog() + .name(INLINE_CATALOG_NAME) + .inject(cataloged -> injectJsonSchemas(cataloged, asyncapi, messages, APPLICATION_JSON)) + .build() + .build() + .build(); + } + } + } + return options; + } +} diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AyncapiKafkaProtocol.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AyncapiKafkaProtocol.java index dbe6cd174b..6f5dc1004b 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AyncapiKafkaProtocol.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/config/AyncapiKafkaProtocol.java @@ -71,7 +71,7 @@ public NamespaceConfigBuilder injectProtocolClientCache( .name("kafka_cache_client0") .type("kafka") .kind(KindConfig.CACHE_CLIENT) - .inject(b -> this.injectMetrics(b, metricRefs, "kafka")) + .inject(b -> this.injectMetrics(b, metricRefs)) .options(KafkaOptionsConfig::builder) .inject(this::injectKafkaTopicOptions) .build() @@ -81,7 +81,7 @@ public NamespaceConfigBuilder injectProtocolClientCache( .name("kafka_cache_server0") .type("kafka") .kind(KindConfig.CACHE_SERVER) - .inject(b -> this.injectMetrics(b, metricRefs, "kafka")) + .inject(b -> this.injectMetrics(b, metricRefs)) .options(KafkaOptionsConfig::builder) .inject(this::injectKafkaBootstrapOptions) .inject(this::injectKafkaTopicOptions) diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiComponents.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiComponents.java index 5f751c1b67..185abee13e 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiComponents.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiComponents.java @@ -21,6 +21,7 @@ public class AsyncapiComponents public Map securitySchemes; public Map messages; public Map schemas; + public Map correlationIds; public Map messageTraits; public Map serverVariables; } diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiCorrelationId.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiCorrelationId.java new file mode 100644 index 0000000000..44569ad89d --- /dev/null +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiCorrelationId.java @@ -0,0 +1,25 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.binding.asyncapi.internal.model; + +import jakarta.json.bind.annotation.JsonbProperty; + +public class AsyncapiCorrelationId +{ + public String location; + + @JsonbProperty("$ref") + public String ref; +} diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiItem.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiItem.java index aed859d19c..1184b669fe 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiItem.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiItem.java @@ -27,6 +27,7 @@ public class AsyncapiItem public String description; public Integer minimum; public Integer maximum; + public String format; @JsonbProperty("enum") public List values; @JsonbProperty("$ref") diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiMessage.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiMessage.java index 4a0f51d277..b002de02b7 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiMessage.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/model/AsyncapiMessage.java @@ -24,6 +24,7 @@ public class AsyncapiMessage public String contentType; public AsyncapiSchema payload; public List traits; + public AsyncapiCorrelationId correlationId; @JsonbProperty("$ref") public String ref; diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/AsyncapiClientFactory.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/AsyncapiClientFactory.java index e8f848b4cc..7c9c479ff0 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/AsyncapiClientFactory.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/AsyncapiClientFactory.java @@ -15,6 +15,7 @@ package io.aklivity.zilla.runtime.binding.asyncapi.internal.stream; import java.util.function.Consumer; +import java.util.function.Function; import java.util.function.LongFunction; import java.util.function.LongSupplier; import java.util.function.LongUnaryOperator; @@ -35,6 +36,7 @@ import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.BeginFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.DataFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.EndFW; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.ExtensionFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.FlushFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.ResetFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.WindowFW; @@ -49,6 +51,9 @@ public final class AsyncapiClientFactory implements AsyncapiStreamFactory { private static final String MQTT_TYPE_NAME = "mqtt"; + private static final String HTTP_TYPE_NAME = "http"; + private static final String SSE_TYPE_NAME = "sse"; + private static final String KAFKA_TYPE_NAME = "kafka"; private static final OctetsFW EMPTY_OCTETS = new OctetsFW().wrap(new UnsafeBuffer(), 0, 0); private final BeginFW beginRO = new BeginFW(); @@ -68,6 +73,7 @@ public final class AsyncapiClientFactory implements AsyncapiStreamFactory private final FlushFW.Builder flushRW = new FlushFW.Builder(); private final AsyncapiBeginExFW asyncapiBeginExRO = new AsyncapiBeginExFW(); + private final ExtensionFW extensionRO = new ExtensionFW(); private final AsyncapiBeginExFW.Builder asyncapiBeginExRW = new AsyncapiBeginExFW.Builder(); @@ -77,6 +83,7 @@ public final class AsyncapiClientFactory implements AsyncapiStreamFactory private final BindingHandler streamFactory; private final LongUnaryOperator supplyInitialId; private final LongUnaryOperator supplyReplyId; + private final Function supplyTypeId; private final LongSupplier supplyTraceId; private final LongFunction supplyCatalog; private final Consumer attachComposite; @@ -86,7 +93,7 @@ public final class AsyncapiClientFactory implements AsyncapiStreamFactory private final int mqttTypeId; private final AsyncapiConfiguration config; private final AsyncapiClientNamespaceGenerator namespaceGenerator; - + private final Long2ObjectHashMap compositeTypes; public AsyncapiClientFactory( AsyncapiConfiguration config, @@ -102,11 +109,17 @@ public AsyncapiClientFactory( this.supplyReplyId = context::supplyReplyId; this.supplyTraceId = context::supplyTraceId; this.supplyCatalog = context::supplyCatalog; + this.supplyTypeId = context::supplyTypeId; this.attachComposite = context::attachComposite; this.detachComposite = context::detachComposite; this.bindings = new Long2ObjectHashMap<>(); this.asyncapiTypeId = context.supplyTypeId(AsyncapiBinding.NAME); this.mqttTypeId = context.supplyTypeId(MQTT_TYPE_NAME); + this.compositeTypes = new Long2ObjectHashMap<>(); + compositeTypes.put(context.supplyTypeId(MQTT_TYPE_NAME), MQTT_TYPE_NAME); + compositeTypes.put(context.supplyTypeId(HTTP_TYPE_NAME), HTTP_TYPE_NAME); + compositeTypes.put(context.supplyTypeId(SSE_TYPE_NAME), SSE_TYPE_NAME); + compositeTypes.put(context.supplyTypeId(KAFKA_TYPE_NAME), KAFKA_TYPE_NAME); } @Override @@ -166,7 +179,9 @@ public MessageConsumer newStream( final long apiId = asyncapiBeginEx.apiId(); final String operationId = asyncapiBeginEx.operationId().asString(); - final long resolvedId = binding.resolveCompositeResolvedId(apiId); + final ExtensionFW extensionEx = asyncapiBeginEx.extension().get(extensionRO::tryWrap); + + final long resolvedId = binding.resolveCompositeResolvedId(apiId, compositeTypes.get(extensionEx.typeId())); if (resolvedId != -1) { @@ -388,8 +403,7 @@ private void onAsyncapiReset( final long traceId = reset.traceId(); assert acknowledge <= sequence; - assert sequence <= replySeq; - assert acknowledge >= replyAck; + // assert acknowledge >= replyAck; assert maximum >= replyMax; replyAck = acknowledge; diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/AsyncapiProxyFactory.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/AsyncapiProxyFactory.java index df5f5ffdc0..812086286e 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/AsyncapiProxyFactory.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/AsyncapiProxyFactory.java @@ -39,6 +39,7 @@ import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.BeginFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.DataFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.EndFW; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.ExtensionFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.FlushFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.ResetFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.WindowFW; @@ -53,6 +54,10 @@ public final class AsyncapiProxyFactory implements AsyncapiStreamFactory { private static final OctetsFW EMPTY_OCTETS = new OctetsFW().wrap(new UnsafeBuffer(), 0, 0); + private static final String MQTT_TYPE_NAME = "mqtt"; + private static final String HTTP_TYPE_NAME = "http"; + private static final String SSE_TYPE_NAME = "sse"; + private final BeginFW beginRO = new BeginFW(); private final DataFW dataRO = new DataFW(); private final EndFW endRO = new EndFW(); @@ -70,6 +75,7 @@ public final class AsyncapiProxyFactory implements AsyncapiStreamFactory private final FlushFW.Builder flushRW = new FlushFW.Builder(); private final AsyncapiBeginExFW asyncapiBeginExRO = new AsyncapiBeginExFW(); + private final ExtensionFW extensionRO = new ExtensionFW(); private final AsyncapiBeginExFW.Builder asyncapiBeginExRW = new AsyncapiBeginExFW.Builder(); @@ -88,6 +94,7 @@ public final class AsyncapiProxyFactory implements AsyncapiStreamFactory private final Long2LongHashMap apiIds; private final AsyncapiConfiguration config; private final AsyncapiProxyNamespaceGenerator namespaceGenerator; + private final Long2ObjectHashMap compositeTypes; private final int asyncapiTypeId; @@ -111,6 +118,10 @@ public AsyncapiProxyFactory( this.bindings = new Long2ObjectHashMap<>(); this.apiIds = new Long2LongHashMap(-1); this.asyncapiTypeId = context.supplyTypeId(AsyncapiBinding.NAME); + this.compositeTypes = new Long2ObjectHashMap<>(); + compositeTypes.put(context.supplyTypeId(MQTT_TYPE_NAME), MQTT_TYPE_NAME); + compositeTypes.put(context.supplyTypeId(HTTP_TYPE_NAME), HTTP_TYPE_NAME); + compositeTypes.put(context.supplyTypeId(SSE_TYPE_NAME), SSE_TYPE_NAME); } @@ -167,7 +178,10 @@ public MessageConsumer newStream( final long apiId = asyncapiBeginEx.apiId(); final String operationId = asyncapiBeginEx.operationId().asString(); - final long compositeResolvedId = binding.resolveCompositeResolvedId(apiId); + final ExtensionFW extensionEx = asyncapiBeginEx.extension().get(extensionRO::tryWrap); + + final long compositeResolvedId = binding.resolveCompositeResolvedId(apiId, + compositeTypes.get(extensionEx.typeId())); apiIds.put(apiId, apiId); if (compositeResolvedId != -1) @@ -1467,7 +1481,6 @@ private void doAsyncapiClientBegin( .wrap(extBuffer, 0, extBuffer.capacity()) .typeId(asyncapiTypeId) .apiId(apiId) - .operationId((String) null) .extension(extension) .build(); diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/AsyncapiServerFactory.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/AsyncapiServerFactory.java index b32ebe11fd..9c67561bf0 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/AsyncapiServerFactory.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/AsyncapiServerFactory.java @@ -37,10 +37,12 @@ import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.BeginFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.DataFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.EndFW; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.ExtensionFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.FlushFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.HttpBeginExFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.MqttBeginExFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.ResetFW; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.SseBeginExFW; import io.aklivity.zilla.runtime.binding.asyncapi.internal.types.stream.WindowFW; import io.aklivity.zilla.runtime.engine.EngineContext; import io.aklivity.zilla.runtime.engine.binding.BindingHandler; @@ -54,10 +56,14 @@ public final class AsyncapiServerFactory implements AsyncapiStreamFactory { private static final String MQTT_TYPE_NAME = "mqtt"; private static final String HTTP_TYPE_NAME = "http"; + private static final String SSE_TYPE_NAME = "sse"; private static final OctetsFW EMPTY_OCTETS = new OctetsFW().wrap(new UnsafeBuffer(), 0, 0); private final BeginFW beginRO = new BeginFW(); private final BeginFW compositeBeginRO = new BeginFW(); + private final ExtensionFW extensionRO = new ExtensionFW(); private final HttpBeginExFW httpBeginRO = new HttpBeginExFW(); + private final SseBeginExFW sseBeginRO = new SseBeginExFW(); + private final MqttBeginExFW mqttBeginRO = new MqttBeginExFW(); private final DataFW dataRO = new DataFW(); private final EndFW endRO = new EndFW(); private final FlushFW flushRO = new FlushFW(); @@ -74,8 +80,6 @@ public final class AsyncapiServerFactory implements AsyncapiStreamFactory private final FlushFW.Builder flushRW = new FlushFW.Builder(); private final AsyncapiBeginExFW asyncapiBeginExRO = new AsyncapiBeginExFW(); - private final MqttBeginExFW mqttBeginExRO = new MqttBeginExFW(); - private final HttpBeginExFW httpBeginExRO = new HttpBeginExFW(); private final AsyncapiBeginExFW.Builder asyncapiBeginExRW = new AsyncapiBeginExFW.Builder(); @@ -93,6 +97,7 @@ public final class AsyncapiServerFactory implements AsyncapiStreamFactory private final Long2ObjectHashMap bindings; private final int asyncapiTypeId; private final int mqttTypeId; + private final int sseTypeId; private final int httpTypeId; private final AsyncapiConfiguration config; private final AsyncapiServerNamespaceGenerator namespaceGenerator; @@ -118,6 +123,7 @@ public AsyncapiServerFactory( this.asyncapiTypeId = context.supplyTypeId(AsyncapiBinding.NAME); this.mqttTypeId = context.supplyTypeId(MQTT_TYPE_NAME); this.httpTypeId = context.supplyTypeId(HTTP_TYPE_NAME); + this.sseTypeId = context.supplyTypeId(SSE_TYPE_NAME); } @Override @@ -177,10 +183,21 @@ public MessageConsumer newStream( if (route != null) { - final int compositeTypeId = supplyTypeId.apply(binding.getCompositeOriginType(originId)); + final ExtensionFW extensionEx = begin.extension().get(extensionRO::tryWrap); + String operationId = null; + if (extensionEx.typeId() == httpTypeId) + { + operationId = binding.resolveHttpOperationId(extension.get(httpBeginRO::tryWrap)); + } + else if (extensionEx.typeId() == mqttTypeId) + { + operationId = binding.resolveMqttOperationId(extension.get(mqttBeginRO::tryWrap)); + } + else if (extensionEx.typeId() == sseTypeId) + { + operationId = binding.resolveSseOperationId(extension.get(sseBeginRO::tryWrap)); + } - final String operationId = compositeTypeId == httpTypeId ? - binding.resolveOperationId(extension.get(httpBeginRO::tryWrap)) : null; final long apiId = binding.resolveApiId(originId); newStream = new CompositeStream( receiver, diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/view/AsyncapiChannelView.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/view/AsyncapiChannelView.java index 7b087a05ad..7bc06f40df 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/view/AsyncapiChannelView.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/view/AsyncapiChannelView.java @@ -50,7 +50,7 @@ private AsyncapiChannelView( Map channels, AsyncapiChannel channel) { - super(channels, "#/channels/(\\w+)"); + super(channels, "#/channels/(.+)"); this.channel = channel.ref == null ? channel : resolveRef(channel.ref); } } diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/view/AsyncapiCorrelationIdView.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/view/AsyncapiCorrelationIdView.java new file mode 100644 index 0000000000..d74d06482f --- /dev/null +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/view/AsyncapiCorrelationIdView.java @@ -0,0 +1,68 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.binding.asyncapi.internal.view; + +import java.util.Map; + +import jakarta.json.bind.annotation.JsonbPropertyOrder; + +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiCorrelationId; + +@JsonbPropertyOrder({ + "type", + "items", + "properties", + "required" +}) +public final class AsyncapiCorrelationIdView extends AsyncapiResolvable +{ + private final AsyncapiCorrelationId correlationId; + private final Map correlationIds; + + public String refKey() + { + return key; + } + public AsyncapiCorrelationId correlationId() + { + return correlationId; + } + + public String location() + { + return correlationId.location; + } + + public static AsyncapiCorrelationIdView of( + Map correlationIds, + AsyncapiCorrelationId correlationId) + { + return new AsyncapiCorrelationIdView(correlationIds, correlationId); + } + + private AsyncapiCorrelationIdView( + Map correlationIds, + AsyncapiCorrelationId correlationId) + { + super(correlationIds, "#/components/correlationIds/(\\w+)"); + if (correlationId.ref != null) + { + correlationId = resolveRef(correlationId.ref); + } + + this.correlationIds = correlationIds; + this.correlationId = correlationId; + } +} diff --git a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/view/AsyncapiMessageView.java b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/view/AsyncapiMessageView.java index 6ee6094e17..232ba13676 100644 --- a/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/view/AsyncapiMessageView.java +++ b/runtime/binding-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/view/AsyncapiMessageView.java @@ -17,6 +17,7 @@ import java.util.List; import java.util.Map; +import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiCorrelationId; import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiMessage; import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiSchema; import io.aklivity.zilla.runtime.binding.asyncapi.internal.model.AsyncapiTrait; @@ -49,6 +50,11 @@ public List traits() return message.traits; } + public AsyncapiCorrelationId correlationId() + { + return message.correlationId; + } + public static AsyncapiMessageView of( Map messages, AsyncapiMessage asyncapiMessage) diff --git a/runtime/binding-asyncapi/src/main/moditect/module-info.java b/runtime/binding-asyncapi/src/main/moditect/module-info.java index 48fdc65612..52d5bd1652 100644 --- a/runtime/binding-asyncapi/src/main/moditect/module-info.java +++ b/runtime/binding-asyncapi/src/main/moditect/module-info.java @@ -19,8 +19,11 @@ requires io.aklivity.zilla.runtime.engine; requires io.aklivity.zilla.runtime.binding.mqtt; requires io.aklivity.zilla.runtime.binding.http; + requires io.aklivity.zilla.runtime.binding.sse; requires io.aklivity.zilla.runtime.binding.kafka; requires io.aklivity.zilla.runtime.binding.mqtt.kafka; + requires io.aklivity.zilla.runtime.binding.http.kafka; + requires io.aklivity.zilla.runtime.binding.sse.kafka; requires io.aklivity.zilla.runtime.binding.tcp; requires io.aklivity.zilla.runtime.binding.tls; requires io.aklivity.zilla.runtime.catalog.inline; @@ -28,6 +31,7 @@ requires io.aklivity.zilla.runtime.vault.filesystem; requires io.aklivity.zilla.runtime.model.core; requires io.aklivity.zilla.runtime.model.json; + requires io.aklivity.zilla.runtime.common; requires org.leadpony.justify; opens io.aklivity.zilla.runtime.binding.asyncapi.internal.model; diff --git a/runtime/binding-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/client/AsyncapiIT.java b/runtime/binding-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/client/AsyncapiIT.java index 1579c36616..362d7b2847 100644 --- a/runtime/binding-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/client/AsyncapiIT.java +++ b/runtime/binding-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/client/AsyncapiIT.java @@ -24,10 +24,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; @@ -37,6 +37,7 @@ public class AsyncapiIT private final K3poRule k3po = new K3poRule() .addScriptRoot("mqtt", "io/aklivity/zilla/specs/binding/asyncapi/streams/mqtt") .addScriptRoot("http", "io/aklivity/zilla/specs/binding/asyncapi/streams/http") + .addScriptRoot("sse", "io/aklivity/zilla/specs/binding/asyncapi/streams/sse") .addScriptRoot("kafka", "io/aklivity/zilla/specs/binding/asyncapi/streams/kafka") .addScriptRoot("asyncapi", "io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi"); @@ -50,6 +51,7 @@ public class AsyncapiIT .external("mqtt0") .external("http0") .external("kafka0") + .external("sse0") .clean(); @Rule @@ -93,4 +95,17 @@ public void shouldProduceMessage() throws Exception { k3po.finish(); } + + @Test + @Configuration("client.sse.yaml") + @Specification({ + "${asyncapi}/sse/data.multiple/client", + "${sse}/data.multiple/server" + }) + @Configure(name = ASYNCAPI_TARGET_ROUTE_ID_NAME, value = "4294967301") + @ScriptProperty("serverAddress \"zilla://streams/sse0\"") + public void shouldReceiveMultipleData() throws Exception + { + k3po.finish(); + } } diff --git a/runtime/binding-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/proxy/AsyncapiIT.java b/runtime/binding-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/proxy/AsyncapiIT.java index ce7ed7df1b..12ec819399 100644 --- a/runtime/binding-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/proxy/AsyncapiIT.java +++ b/runtime/binding-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/proxy/AsyncapiIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; @@ -57,4 +57,37 @@ public void shouldPublish() throws Exception { k3po.finish(); } + + @Test + @Configuration("proxy.http.kafka.yaml") + @Specification({ + "${asyncapi}/proxy.http.create.pet/client", + "${asyncapi}/proxy.kafka.create.pet/server" + }) + public void shouldCreatePet() throws Exception + { + k3po.finish(); + } + + @Test + @Configuration("proxy.http.kafka.async.yaml") + @Specification({ + "${asyncapi}/proxy.http.async.verify.customer/client", + "${asyncapi}/proxy.kafka.async.verify.customer/server" + }) + public void shouldVerifyCustomerAsync() throws Exception + { + k3po.finish(); + } + + @Test + @Configuration("proxy.sse.kafka.yaml") + @Specification({ + "${asyncapi}/proxy.sse.server.sent.messages/client", + "${asyncapi}/proxy.kafka.server.sent.messages/server" + }) + public void shouldReceiveServerSentMessages() throws Exception + { + k3po.finish(); + } } diff --git a/runtime/binding-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/server/AsyncapiIT.java b/runtime/binding-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/server/AsyncapiIT.java index 6aedafa05e..548b97d2ae 100644 --- a/runtime/binding-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/server/AsyncapiIT.java +++ b/runtime/binding-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/asyncapi/internal/stream/server/AsyncapiIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; @@ -34,6 +34,7 @@ public class AsyncapiIT private final K3poRule k3po = new K3poRule() .addScriptRoot("mqtt", "io/aklivity/zilla/specs/binding/asyncapi/streams/mqtt") .addScriptRoot("http", "io/aklivity/zilla/specs/binding/asyncapi/streams/http") + .addScriptRoot("sse", "io/aklivity/zilla/specs/binding/asyncapi/streams/sse") .addScriptRoot("asyncapi", "io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi"); private final TestRule timeout = new DisableOnDebug(new Timeout(10, SECONDS)); @@ -71,6 +72,17 @@ public void shouldCreatePet() throws Exception k3po.finish(); } + @Test + @Configuration("server.sse.yaml") + @Specification({ + "${sse}/data.multiple/client", + "${asyncapi}/sse/data.multiple/server" + }) + public void shouldReceiveMultipleData() throws Exception + { + k3po.finish(); + } + @Test @Configuration("server.multi.protocol.yaml") @Specification({ diff --git a/runtime/binding-echo/pom.xml b/runtime/binding-echo/pom.xml index 9058f89521..ca5895eca6 100644 --- a/runtime/binding-echo/pom.xml +++ b/runtime/binding-echo/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.78 0 @@ -60,13 +58,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -166,7 +164,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/bench/EchoWorker.java b/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/bench/EchoWorker.java index 175b20f3cf..ef76fa18d2 100644 --- a/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/bench/EchoWorker.java +++ b/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/bench/EchoWorker.java @@ -16,8 +16,8 @@ package io.aklivity.zilla.runtime.binding.echo.internal.bench; import java.net.InetAddress; -import java.net.URL; import java.nio.channels.SelectableChannel; +import java.nio.file.Path; import java.time.Clock; import java.util.function.LongSupplier; @@ -263,6 +263,13 @@ public int supplyEventId( return 0; } + @Override + public String supplyEventName( + int eventId) + { + return ""; + } + @Override public BindingHandler streamFactory() { @@ -312,8 +319,8 @@ public ConverterHandler supplyWriteConverter( } @Override - public URL resolvePath( - String path) + public Path resolvePath( + String location) { return null; } diff --git a/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/streams/ServerIT.java b/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/streams/ServerIT.java index cbfe28fb19..6ef0f50297 100644 --- a/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/streams/ServerIT.java +++ b/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/streams/ServerIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-fan/pom.xml b/runtime/binding-fan/pom.xml index 8c7313de3a..e0c63bfca3 100644 --- a/runtime/binding-fan/pom.xml +++ b/runtime/binding-fan/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.75 0 @@ -66,13 +64,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -167,7 +165,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-fan/src/test/java/io/aklivity/zilla/runtime/binding/fan/internal/streams/ServerIT.java b/runtime/binding-fan/src/test/java/io/aklivity/zilla/runtime/binding/fan/internal/streams/ServerIT.java index b327a0d7d1..98cf9505b6 100644 --- a/runtime/binding-fan/src/test/java/io/aklivity/zilla/runtime/binding/fan/internal/streams/ServerIT.java +++ b/runtime/binding-fan/src/test/java/io/aklivity/zilla/runtime/binding/fan/internal/streams/ServerIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-filesystem/pom.xml b/runtime/binding-filesystem/pom.xml index 7bed1aad7b..f3d3806697 100644 --- a/runtime/binding-filesystem/pom.xml +++ b/runtime/binding-filesystem/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.81 0 @@ -76,13 +74,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -200,7 +198,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-filesystem/src/test/java/io/aklivity/zilla/runtime/binding/filesystem/internal/stream/FileSystemServerIT.java b/runtime/binding-filesystem/src/test/java/io/aklivity/zilla/runtime/binding/filesystem/internal/stream/FileSystemServerIT.java index 8462fb0975..69e61dbdfe 100644 --- a/runtime/binding-filesystem/src/test/java/io/aklivity/zilla/runtime/binding/filesystem/internal/stream/FileSystemServerIT.java +++ b/runtime/binding-filesystem/src/test/java/io/aklivity/zilla/runtime/binding/filesystem/internal/stream/FileSystemServerIT.java @@ -29,9 +29,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-grpc-kafka/pom.xml b/runtime/binding-grpc-kafka/pom.xml index 0a637e4565..a414a2d7ce 100644 --- a/runtime/binding-grpc-kafka/pom.xml +++ b/runtime/binding-grpc-kafka/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.88 0 @@ -76,13 +74,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -177,7 +175,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-grpc-kafka/src/test/java/io/aklivity/zilla/runtime/blinding/grpc/kafka/internal/stream/GrpcKafkaFetchProxyIT.java b/runtime/binding-grpc-kafka/src/test/java/io/aklivity/zilla/runtime/blinding/grpc/kafka/internal/stream/GrpcKafkaFetchProxyIT.java index d899699271..17e4fa13ed 100644 --- a/runtime/binding-grpc-kafka/src/test/java/io/aklivity/zilla/runtime/blinding/grpc/kafka/internal/stream/GrpcKafkaFetchProxyIT.java +++ b/runtime/binding-grpc-kafka/src/test/java/io/aklivity/zilla/runtime/blinding/grpc/kafka/internal/stream/GrpcKafkaFetchProxyIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-grpc-kafka/src/test/java/io/aklivity/zilla/runtime/blinding/grpc/kafka/internal/stream/GrpcKafkaProduceProxyIT.java b/runtime/binding-grpc-kafka/src/test/java/io/aklivity/zilla/runtime/blinding/grpc/kafka/internal/stream/GrpcKafkaProduceProxyIT.java index f89fecd982..40791c0f3c 100644 --- a/runtime/binding-grpc-kafka/src/test/java/io/aklivity/zilla/runtime/blinding/grpc/kafka/internal/stream/GrpcKafkaProduceProxyIT.java +++ b/runtime/binding-grpc-kafka/src/test/java/io/aklivity/zilla/runtime/blinding/grpc/kafka/internal/stream/GrpcKafkaProduceProxyIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-grpc/pom.xml b/runtime/binding-grpc/pom.xml index 1c24bd59fb..3e4a284179 100644 --- a/runtime/binding-grpc/pom.xml +++ b/runtime/binding-grpc/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.8 0 @@ -81,13 +79,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -207,7 +205,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-grpc/src/main/java/io/aklivity/zilla/runtime/binding/grpc/internal/config/GrpcOptionsConfigAdapter.java b/runtime/binding-grpc/src/main/java/io/aklivity/zilla/runtime/binding/grpc/internal/config/GrpcOptionsConfigAdapter.java index 41d2d9131b..19e7e18acf 100644 --- a/runtime/binding-grpc/src/main/java/io/aklivity/zilla/runtime/binding/grpc/internal/config/GrpcOptionsConfigAdapter.java +++ b/runtime/binding-grpc/src/main/java/io/aklivity/zilla/runtime/binding/grpc/internal/config/GrpcOptionsConfigAdapter.java @@ -41,7 +41,7 @@ public final class GrpcOptionsConfigAdapter implements OptionsConfigAdapterSpi, private final GrpcProtobufParser parser = new GrpcProtobufParser(); - private Function readURL; + private Function readResource; @Override public Kind kind() @@ -88,7 +88,7 @@ public OptionsConfig adaptFromJson( public void adaptContext( ConfigAdapterContext context) { - this.readURL = context::readURL; + this.readResource = context::readResource; } private List asListProtobufs( @@ -103,7 +103,7 @@ private GrpcProtobufConfig asProtobuf( JsonValue value) { final String location = ((JsonString) value).getString(); - final String protobuf = readURL.apply(location); + final String protobuf = readResource.apply(location); return parser.parse(location, protobuf); } diff --git a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/config/GrpcOptionsConfigAdapterTest.java b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/config/GrpcOptionsConfigAdapterTest.java index aeb7efe820..e33893f8ff 100644 --- a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/config/GrpcOptionsConfigAdapterTest.java +++ b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/config/GrpcOptionsConfigAdapterTest.java @@ -66,7 +66,7 @@ public void initJson() throws IOException { content = new String(resource.readAllBytes(), UTF_8); } - Mockito.doReturn(content).when(context).readURL("protobuf/echo.proto"); + Mockito.doReturn(content).when(context).readResource("protobuf/echo.proto"); adapter = new OptionsConfigAdapter(OptionsConfigAdapterSpi.Kind.BINDING, context); adapter.adaptType("grpc"); JsonbConfig config = new JsonbConfig() diff --git a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/BidiStreamRpcIT.java b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/BidiStreamRpcIT.java index 8e85862b20..2ee7ba42f3 100644 --- a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/BidiStreamRpcIT.java +++ b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/BidiStreamRpcIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/ClientStreamRpcIT.java b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/ClientStreamRpcIT.java index 9af46146f3..1eeab7b11a 100644 --- a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/ClientStreamRpcIT.java +++ b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/ClientStreamRpcIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/ServerStreamRpcIT.java b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/ServerStreamRpcIT.java index cffb69558f..a0ad2a48cc 100644 --- a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/ServerStreamRpcIT.java +++ b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/ServerStreamRpcIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/UnaryRpcIT.java b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/UnaryRpcIT.java index 5e167ac799..1ef2e0509b 100644 --- a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/UnaryRpcIT.java +++ b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/client/UnaryRpcIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/BidiStreamRpcIT.java b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/BidiStreamRpcIT.java index 69f274b748..326f6ce671 100644 --- a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/BidiStreamRpcIT.java +++ b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/BidiStreamRpcIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/ClientStreamRpcIT.java b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/ClientStreamRpcIT.java index ee467eaed3..d14e926f06 100644 --- a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/ClientStreamRpcIT.java +++ b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/ClientStreamRpcIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/RejectedRpcIT.java b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/RejectedRpcIT.java index 5162b7c553..953cc16be6 100644 --- a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/RejectedRpcIT.java +++ b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/RejectedRpcIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/ServerStreamRpcIT.java b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/ServerStreamRpcIT.java index ba703f6c6c..f8c0bd5ccf 100644 --- a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/ServerStreamRpcIT.java +++ b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/ServerStreamRpcIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/UnaryRpcIT.java b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/UnaryRpcIT.java index f8d3938d3a..7565bf3d66 100644 --- a/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/UnaryRpcIT.java +++ b/runtime/binding-grpc/src/test/java/io/aklivity/zilla/runtime/binding/grpc/internal/streams/server/UnaryRpcIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http-filesystem/pom.xml b/runtime/binding-http-filesystem/pom.xml index 3729491236..3a375db09d 100644 --- a/runtime/binding-http-filesystem/pom.xml +++ b/runtime/binding-http-filesystem/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.90 0 @@ -76,13 +74,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -177,7 +175,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-http-filesystem/src/test/java/io/aklivity/zilla/runtime/binding/http/filesystem/internal/stream/HttpFileSystemProxyIT.java b/runtime/binding-http-filesystem/src/test/java/io/aklivity/zilla/runtime/binding/http/filesystem/internal/stream/HttpFileSystemProxyIT.java index d4787a0e5c..7999e79e7f 100644 --- a/runtime/binding-http-filesystem/src/test/java/io/aklivity/zilla/runtime/binding/http/filesystem/internal/stream/HttpFileSystemProxyIT.java +++ b/runtime/binding-http-filesystem/src/test/java/io/aklivity/zilla/runtime/binding/http/filesystem/internal/stream/HttpFileSystemProxyIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http-kafka/pom.xml b/runtime/binding-http-kafka/pom.xml index 54fb2db179..8f97edcb8c 100644 --- a/runtime/binding-http-kafka/pom.xml +++ b/runtime/binding-http-kafka/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.87 0 @@ -76,13 +74,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -177,7 +175,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-http-kafka/src/test/java/io/aklivity/zilla/runtime/binding/http/kafka/internal/stream/HttpKafkaProxyIT.java b/runtime/binding-http-kafka/src/test/java/io/aklivity/zilla/runtime/binding/http/kafka/internal/stream/HttpKafkaProxyIT.java index 4c251827f2..dd59fc02c1 100644 --- a/runtime/binding-http-kafka/src/test/java/io/aklivity/zilla/runtime/binding/http/kafka/internal/stream/HttpKafkaProxyIT.java +++ b/runtime/binding-http-kafka/src/test/java/io/aklivity/zilla/runtime/binding/http/kafka/internal/stream/HttpKafkaProxyIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/pom.xml b/runtime/binding-http/pom.xml index 51ea98c09c..44ffd55a65 100644 --- a/runtime/binding-http/pom.xml +++ b/runtime/binding-http/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.83 0 @@ -66,13 +64,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -167,7 +165,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/config/HttpOptionsConfig.java b/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/config/HttpOptionsConfig.java index 40f0152347..f7e318deea 100644 --- a/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/config/HttpOptionsConfig.java +++ b/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/config/HttpOptionsConfig.java @@ -27,6 +27,7 @@ import io.aklivity.zilla.runtime.binding.http.internal.types.String16FW; import io.aklivity.zilla.runtime.binding.http.internal.types.String8FW; +import io.aklivity.zilla.runtime.engine.config.ModelConfig; import io.aklivity.zilla.runtime.engine.config.OptionsConfig; public final class HttpOptionsConfig extends OptionsConfig @@ -55,41 +56,46 @@ public static HttpOptionsConfigBuilder builder( HttpAuthorizationConfig authorization, List requests) { - super(requests != null && !requests.isEmpty() - ? requests.stream() - .flatMap(request -> Stream.concat( - Stream.of(request.content), - Stream.concat( - request.headers != null - ? request.headers.stream().flatMap(header -> Stream.of(header != null ? header.model : null)) - : Stream.empty(), - Stream.concat( - request.pathParams != null - ? request.pathParams.stream().flatMap(param -> Stream.of(param != null ? param.model : null)) - : Stream.empty(), - Stream.concat( - request.queryParams != null - ? request.queryParams.stream().flatMap(param -> Stream.of(param != null ? param.model : null)) - : Stream.empty(), - Stream.concat(request.responses != null - ? request.responses.stream().flatMap(param -> Stream.of(param != null - ? param.content - : null)) - : Stream.empty(), request.responses != null - ? request.responses.stream() - .flatMap(response -> response.headers != null - ? response.headers.stream() - .flatMap(param -> Stream.of(param != null ? param.model : null)) - : Stream.empty()) - : Stream.empty()) - )))).filter(Objects::nonNull)) - .collect(Collectors.toList()) - : emptyList()); - + super(resolveModels(requests), List.of()); this.versions = versions; this.overrides = overrides; this.access = access; this.authorization = authorization; this.requests = requests; } + + private static List resolveModels( + List requests) + { + return requests != null && !requests.isEmpty() + ? requests.stream() + .flatMap(request -> Stream.concat( + Stream.of(request.content), + Stream.concat( + request.headers != null + ? request.headers.stream().flatMap(header -> Stream.of(header != null ? header.model : null)) + : Stream.empty(), + Stream.concat( + request.pathParams != null + ? request.pathParams.stream().flatMap(param -> Stream.of(param != null ? param.model : null)) + : Stream.empty(), + Stream.concat( + request.queryParams != null + ? request.queryParams.stream().flatMap(param -> Stream.of(param != null ? param.model : null)) + : Stream.empty(), + Stream.concat(request.responses != null + ? request.responses.stream().flatMap(param -> Stream.of(param != null + ? param.content + : null)) + : Stream.empty(), request.responses != null + ? request.responses.stream() + .flatMap(response -> response.headers != null + ? response.headers.stream() + .flatMap(param -> Stream.of(param != null ? param.model : null)) + : Stream.empty()) + : Stream.empty()) + )))).filter(Objects::nonNull)) + .collect(Collectors.toList()) + : emptyList(); + } } diff --git a/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java b/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java index 221b3097a8..9ffb72a313 100644 --- a/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java +++ b/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java @@ -26,8 +26,6 @@ public final class HttpEventFormatter implements EventFormatterSpi { - private static final String REQUEST_ACCEPTED_FORMAT = "REQUEST_ACCEPTED %s %s %s %s %s"; - private final EventFW eventRO = new EventFW(); private final HttpEventExFW httpEventExRO = new HttpEventExFW(); @@ -50,7 +48,7 @@ public String format( case REQUEST_ACCEPTED: { HttpRequestAcceptedExFW ex = extension.requestAccepted(); - result = String.format(REQUEST_ACCEPTED_FORMAT, identity(ex.identity()), asString(ex.scheme()), asString(ex.method()), + result = String.format("%s %s %s://%s%s", identity(ex.identity()), asString(ex.method()), asString(ex.scheme()), asString(ex.authority()), asString(ex.path())); break; } diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/AdvisoryIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/AdvisoryIT.java index e5ccfac394..4108793702 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/AdvisoryIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/AdvisoryIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ArchitectureIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ArchitectureIT.java index ea7f3326dc..7e9fbaf946 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ArchitectureIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ArchitectureIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ConnectionManagementIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ConnectionManagementIT.java index bac31467bb..b62da75d7d 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ConnectionManagementIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ConnectionManagementIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ConnectionManagementPoolSize1IT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ConnectionManagementPoolSize1IT.java index 0bfb9fa8c5..5976094eb9 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ConnectionManagementPoolSize1IT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ConnectionManagementPoolSize1IT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; @@ -67,6 +67,7 @@ public void concurrentRequestsSameConnection() throws Exception k3po.finish(); } + @Ignore("io.aklivity.k3po") @Test @Configuration("client.yaml") @Specification({ diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/FlowControlIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/FlowControlIT.java index 65f3fdb5be..73d8cd4142 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/FlowControlIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/FlowControlIT.java @@ -24,10 +24,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/FlowControlLimitsIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/FlowControlLimitsIT.java index 0ccfea3b2c..a447b689b1 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/FlowControlLimitsIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/FlowControlLimitsIT.java @@ -27,9 +27,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/MessageFormatIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/MessageFormatIT.java index b577942d4b..624883ea06 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/MessageFormatIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/MessageFormatIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/TransferCodingsIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/TransferCodingsIT.java index 7cabe02091..5147af8a3b 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/TransferCodingsIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/TransferCodingsIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ValidationIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ValidationIT.java index b36ebe5046..b018c74330 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ValidationIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/client/ValidationIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/AccessControlIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/AccessControlIT.java index 8fd94f97c2..8108fb3cca 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/AccessControlIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/AccessControlIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/AdvisoryIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/AdvisoryIT.java index e85ab6db08..cdd9ce4d0b 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/AdvisoryIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/AdvisoryIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/ArchitectureIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/ArchitectureIT.java index 363a854e9a..0c49285e26 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/ArchitectureIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/ArchitectureIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/AuthorizationIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/AuthorizationIT.java index dc9e916c90..36d7be59b1 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/AuthorizationIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/AuthorizationIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/ConnectionManagementIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/ConnectionManagementIT.java index 6fc76b884c..b4d836ddc3 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/ConnectionManagementIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/ConnectionManagementIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/EventIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/EventIT.java index 18c735874f..44b83857df 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/EventIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/EventIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/FlowControlIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/FlowControlIT.java index 7fd84bf205..1b45001fcf 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/FlowControlIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/FlowControlIT.java @@ -24,10 +24,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/FlowControlLimitsIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/FlowControlLimitsIT.java index 65b32aa182..5ac41c83c7 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/FlowControlLimitsIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/FlowControlLimitsIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/MessageFormatIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/MessageFormatIT.java index 221369ca1e..ba3b32e8db 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/MessageFormatIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/MessageFormatIT.java @@ -25,10 +25,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/TransferCodingsIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/TransferCodingsIT.java index a8808b7794..c13d5a8e29 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/TransferCodingsIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/TransferCodingsIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/ValidationIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/ValidationIT.java index e82208c3dd..de17210fd2 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/ValidationIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7230/server/ValidationIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/AbortIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/AbortIT.java index 4dbd2f566f..6a863240d3 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/AbortIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/AbortIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/ConfigIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/ConfigIT.java index 37eac77678..2bfe6c723e 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/ConfigIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/ConfigIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.EngineConfiguration; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/ConnectionManagementIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/ConnectionManagementIT.java index 47f2198b76..2d6f701a74 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/ConnectionManagementIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/ConnectionManagementIT.java @@ -26,10 +26,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/FlowControlIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/FlowControlIT.java index e0602ac77d..ae418a0448 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/FlowControlIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/FlowControlIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/MessageFormatIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/MessageFormatIT.java index aa747d0f1c..f6692c7d07 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/MessageFormatIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/MessageFormatIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/StartingIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/StartingIT.java index a445a43a84..38ac7fc488 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/StartingIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/StartingIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.EngineConfiguration; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/ValidationIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/ValidationIT.java index 85142bd9ae..307e7f1cc5 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/ValidationIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/ValidationIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/AbortIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/AbortIT.java index 68cb56238e..1a1871532c 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/AbortIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/AbortIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/AccessControlIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/AccessControlIT.java index ecddd20bbc..0f85093391 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/AccessControlIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/AccessControlIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/AuthorizationIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/AuthorizationIT.java index 7ca3be4e52..a109b87f02 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/AuthorizationIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/AuthorizationIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/ConfigIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/ConfigIT.java index 082847bf70..f0a08ff4af 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/ConfigIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/ConfigIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/ConnectionManagementIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/ConnectionManagementIT.java index 531c9a13ff..1df4192ad0 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/ConnectionManagementIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/ConnectionManagementIT.java @@ -27,9 +27,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/EventIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/EventIT.java index a61817a2ee..f1b865bc92 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/EventIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/EventIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/FlowControlIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/FlowControlIT.java index cde9d6e9bd..1d9e6fde75 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/FlowControlIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/FlowControlIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/MessageFormatIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/MessageFormatIT.java index 00340a25a9..79dbcf8790 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/MessageFormatIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/MessageFormatIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/SettingsIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/SettingsIT.java index da3941ca56..1dded0ebbc 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/SettingsIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/SettingsIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/StartingIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/StartingIT.java index 4741673d7a..c0c9f9fc89 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/StartingIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/StartingIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/ValidationIT.java b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/ValidationIT.java index a2e427ad51..6fdce9d82b 100644 --- a/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/ValidationIT.java +++ b/runtime/binding-http/src/test/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/server/ValidationIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka-grpc/pom.xml b/runtime/binding-kafka-grpc/pom.xml index f75bc1a062..dfa58e981f 100644 --- a/runtime/binding-kafka-grpc/pom.xml +++ b/runtime/binding-kafka-grpc/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.85 0 @@ -76,13 +74,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -177,7 +175,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-kafka-grpc/src/main/java/io/aklivity/zilla/runtime/binding/kafka/grpc/config/KafkaGrpcIdempotencyConfig.java b/runtime/binding-kafka-grpc/src/main/java/io/aklivity/zilla/runtime/binding/kafka/grpc/config/KafkaGrpcIdempotencyConfig.java index ab4ecd0cdd..3c74a888b7 100644 --- a/runtime/binding-kafka-grpc/src/main/java/io/aklivity/zilla/runtime/binding/kafka/grpc/config/KafkaGrpcIdempotencyConfig.java +++ b/runtime/binding-kafka-grpc/src/main/java/io/aklivity/zilla/runtime/binding/kafka/grpc/config/KafkaGrpcIdempotencyConfig.java @@ -14,7 +14,6 @@ */ package io.aklivity.zilla.runtime.binding.kafka.grpc.config; - import io.aklivity.zilla.runtime.binding.kafka.grpc.internal.types.String8FW; public final class KafkaGrpcIdempotencyConfig diff --git a/runtime/binding-kafka-grpc/src/test/java/io/aklivity/zilla/runtime/binding/kafka/grpc/internal/stream/KafkaGrpcRemoteServerIT.java b/runtime/binding-kafka-grpc/src/test/java/io/aklivity/zilla/runtime/binding/kafka/grpc/internal/stream/KafkaGrpcRemoteServerIT.java index d52e4f9ba6..61d410fc6f 100644 --- a/runtime/binding-kafka-grpc/src/test/java/io/aklivity/zilla/runtime/binding/kafka/grpc/internal/stream/KafkaGrpcRemoteServerIT.java +++ b/runtime/binding-kafka-grpc/src/test/java/io/aklivity/zilla/runtime/binding/kafka/grpc/internal/stream/KafkaGrpcRemoteServerIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/pom.xml b/runtime/binding-kafka/pom.xml index 22b9fce678..c608820cc1 100644 --- a/runtime/binding-kafka/pom.xml +++ b/runtime/binding-kafka/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.79 5 @@ -66,13 +64,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -167,7 +165,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaOptionsConfig.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaOptionsConfig.java index e597ce09ac..0d7da18c2d 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaOptionsConfig.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaOptionsConfig.java @@ -23,6 +23,7 @@ import java.util.function.Function; import java.util.stream.Stream; +import io.aklivity.zilla.runtime.engine.config.ModelConfig; import io.aklivity.zilla.runtime.engine.config.OptionsConfig; public final class KafkaOptionsConfig extends OptionsConfig @@ -49,15 +50,21 @@ public static KafkaOptionsConfigBuilder builder( List servers, KafkaSaslConfig sasl) { - super(topics != null && !topics.isEmpty() - ? topics.stream() - .flatMap(t -> Stream.of(t.key, t.value)) - .filter(Objects::nonNull) - .collect(toList()) - : emptyList()); + super(resolveModels(topics), List.of()); this.bootstrap = bootstrap; this.topics = topics; this.servers = servers; this.sasl = sasl; } + + private static List resolveModels( + List topics) + { + return topics != null && !topics.isEmpty() + ? topics.stream() + .flatMap(t -> Stream.of(t.key, t.value)) + .filter(Objects::nonNull) + .collect(toList()) + : emptyList(); + } } diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaTopicConfig.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaTopicConfig.java index 679a743b15..9b9c9c84bd 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaTopicConfig.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaTopicConfig.java @@ -15,6 +15,7 @@ */ package io.aklivity.zilla.runtime.binding.kafka.config; +import java.util.List; import java.util.Objects; import java.util.function.Function; @@ -29,6 +30,7 @@ public class KafkaTopicConfig public final KafkaDeltaType deltaType; public final ModelConfig key; public final ModelConfig value; + public final List headers; public static KafkaTopicConfigBuilder builder() { @@ -46,13 +48,15 @@ public static KafkaTopicConfigBuilder builder( KafkaOffsetType defaultOffset, KafkaDeltaType deltaType, ModelConfig key, - ModelConfig value) + ModelConfig value, + List headers) { this.name = name; this.defaultOffset = defaultOffset; this.deltaType = deltaType; this.key = key; this.value = value; + this.headers = headers; } @Override diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaTopicConfigBuilder.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaTopicConfigBuilder.java index 34a423b225..88994a9923 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaTopicConfigBuilder.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaTopicConfigBuilder.java @@ -15,27 +15,41 @@ */ package io.aklivity.zilla.runtime.binding.kafka.config; +import static java.nio.charset.StandardCharsets.UTF_8; +import java.util.ArrayList; +import java.util.List; import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaDeltaType; import io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaOffsetType; +import io.aklivity.zilla.runtime.binding.kafka.internal.types.String32FW; import io.aklivity.zilla.runtime.engine.config.ConfigBuilder; import io.aklivity.zilla.runtime.engine.config.ModelConfig; public final class KafkaTopicConfigBuilder extends ConfigBuilder> { + private static final String PATH = "^\\$\\{message\\.value\\.([A-Za-z_][A-Za-z0-9_]*)\\}$"; + private static final Pattern PATH_PATTERN = Pattern.compile(PATH); + private static final String INTERNAL_PATH_PATTERN = "$.%s"; + + private final Matcher matcher; private final Function mapper; private String name; private KafkaOffsetType defaultOffset; private KafkaDeltaType deltaType; private ModelConfig key; private ModelConfig value; + private List headers; KafkaTopicConfigBuilder( Function mapper) { this.mapper = mapper; + this.headers = new ArrayList<>(); + this.matcher = PATH_PATTERN.matcher(""); } @Override @@ -80,6 +94,22 @@ public KafkaTopicConfigBuilder value( return this; } + public KafkaTopicConfigBuilder header( + String name, + String path) + { + if (this.headers == null) + { + this.headers = new ArrayList<>(); + } + if (matcher.reset(path).matches()) + { + this.headers.add(new KafkaTopicHeaderType(new String32FW(name, UTF_8), + String.format(INTERNAL_PATH_PATTERN, matcher.group(1)))); + } + return this; + } + public , C>> C value( Function>, C> value) { @@ -89,6 +119,6 @@ public , C>> C value( @Override public T build() { - return mapper.apply(new KafkaTopicConfig(name, defaultOffset, deltaType, key, value)); + return mapper.apply(new KafkaTopicConfig(name, defaultOffset, deltaType, key, value, headers)); } } diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaTopicHeaderType.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaTopicHeaderType.java new file mode 100644 index 0000000000..c103c219aa --- /dev/null +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/config/KafkaTopicHeaderType.java @@ -0,0 +1,32 @@ +/* + * Copyright 2021-2023 Aklivity Inc. + * + * Aklivity licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.aklivity.zilla.runtime.binding.kafka.config; + +import io.aklivity.zilla.runtime.binding.kafka.internal.types.String32FW; + +public class KafkaTopicHeaderType +{ + public final String32FW name; + public final String path; + + public KafkaTopicHeaderType( + String32FW name, + String path) + { + this.name = name; + this.path = path; + } +} diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java index 515aa6f08e..4e6bd691ff 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java @@ -27,9 +27,6 @@ public final class KafkaEventFormatter implements EventFormatterSpi { - private static final String AUTHORIZATION_FAILED_FORMAT = "AUTHORIZATION_FAILED %s"; - private static final String API_VERSION_REJECTED_FORMAT = "API_VERSION_REJECTED %d %d"; - private final EventFW eventRO = new EventFW(); private final KafkaEventExFW kafkaEventExRO = new KafkaEventExFW(); @@ -52,22 +49,22 @@ public String format( case AUTHORIZATION_FAILED: { KafkaAuthorizationFailedExFW ex = extension.authorizationFailed(); - result = String.format(AUTHORIZATION_FAILED_FORMAT, identity(ex.identity())); + result = String.format("Unable to authenticate client with identity (%s).", asString(ex.identity())); break; } case API_VERSION_REJECTED: { final KafkaApiVersionRejectedExFW ex = extension.apiVersionRejected(); - result = String.format(API_VERSION_REJECTED_FORMAT, ex.apiKey(), ex.apiVersion()); + result = String.format("%d %d", ex.apiKey(), ex.apiVersion()); } } return result; } - private static String identity( - StringFW identity) + private static String asString( + StringFW stringFW) { - int length = identity.length(); - return length <= 0 ? "-" : identity.asString(); + String s = stringFW.asString(); + return s == null ? "" : s; } } diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/cache/KafkaCacheCursorFactory.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/cache/KafkaCacheCursorFactory.java index c756aff33b..bcd9eec458 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/cache/KafkaCacheCursorFactory.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/cache/KafkaCacheCursorFactory.java @@ -837,6 +837,11 @@ public long test( final ArrayFW headers = cacheEntry.headers(); match.value = 0L; headers.forEach(header -> match.value |= test(header)); + final ArrayFW trailers = cacheEntry.trailers(); + if (match.value == 0L && !trailers.isEmpty()) + { + trailers.forEach(trailer -> match.value |= test(trailer)); + } return match.value; } } diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/cache/KafkaCachePartition.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/cache/KafkaCachePartition.java index c68aca9e6a..1b171de7c9 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/cache/KafkaCachePartition.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/cache/KafkaCachePartition.java @@ -42,6 +42,7 @@ import java.nio.ByteBuffer; import java.nio.file.Files; import java.nio.file.Path; +import java.util.List; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Function; import java.util.function.IntFunction; @@ -56,6 +57,7 @@ import org.agrona.DirectBuffer; import org.agrona.ExpandableArrayBuffer; +import org.agrona.ExpandableDirectByteBuffer; import org.agrona.LangUtil; import org.agrona.MutableDirectBuffer; import org.agrona.collections.MutableInteger; @@ -63,6 +65,7 @@ import org.agrona.io.DirectBufferInputStream; import org.agrona.io.ExpandableDirectBufferOutputStream; +import io.aklivity.zilla.runtime.binding.kafka.config.KafkaTopicHeaderType; import io.aklivity.zilla.runtime.binding.kafka.internal.types.Array32FW; import io.aklivity.zilla.runtime.binding.kafka.internal.types.ArrayFW; import io.aklivity.zilla.runtime.binding.kafka.internal.types.Flyweight; @@ -72,6 +75,7 @@ import io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaKeyFW; import io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaOffsetType; import io.aklivity.zilla.runtime.binding.kafka.internal.types.OctetsFW; +import io.aklivity.zilla.runtime.binding.kafka.internal.types.String32FW; import io.aklivity.zilla.runtime.binding.kafka.internal.types.Varint32FW; import io.aklivity.zilla.runtime.binding.kafka.internal.types.cache.KafkaCacheDeltaFW; import io.aklivity.zilla.runtime.binding.kafka.internal.types.cache.KafkaCacheEntryFW; @@ -119,6 +123,9 @@ public final class KafkaCachePartition private final Varint32FW.Builder varIntRW = new Varint32FW.Builder().wrap(new UnsafeBuffer(new byte[5]), 0, 5); private final Array32FW headersRO = new Array32FW(new KafkaHeaderFW()); + private final Array32FW.Builder trailersRW = + new Array32FW.Builder<>(new KafkaHeaderFW.Builder(), new KafkaHeaderFW()) + .wrap(new ExpandableDirectByteBuffer(512), 0, 8192); private final DirectBufferInputStream ancestorIn = new DirectBufferInputStream(); private final DirectBufferInputStream headIn = new DirectBufferInputStream(); @@ -139,6 +146,7 @@ public final class KafkaCachePartition private KafkaCacheEntryFW ancestorEntry; private final AtomicLong produceCapacity; + private final OctetsFW octetsRO = new OctetsFW(); public KafkaCachePartition( Path location, @@ -347,15 +355,16 @@ public void writeEntry( KafkaDeltaType deltaType, ConverterHandler convertKey, ConverterHandler convertValue, - boolean verbose) + boolean verbose, + List headerTypes) { final long keyHash = computeHash(key); final int valueLength = value != null ? value.sizeof() : -1; writeEntryStart(context, traceId, bindingId, offset, entryMark, valueMark, timestamp, producerId, key, keyHash, valueLength, ancestor, entryFlags, deltaType, value, convertKey, convertValue, verbose); - writeEntryContinue(context, traceId, bindingId, FLAGS_COMPLETE, offset, entryMark, valueMark, value, - convertValue, verbose); - writeEntryFinish(headers, deltaType); + writeEntryContinue(value); + writeEntryFinish(headers, deltaType, context, traceId, bindingId, FLAGS_COMPLETE, offset, entryMark, valueMark, + convertValue, verbose, headerTypes); } public void writeEntryStart( @@ -482,6 +491,26 @@ public void writeEntryStart( } public void writeEntryContinue( + OctetsFW payload) + { + final Node head = sentinel.previous; + assert head != sentinel; + + final KafkaCacheSegment headSegment = head.segment; + assert headSegment != null; + + final KafkaCacheFile logFile = headSegment.logFile(); + + final int logAvailable = logFile.available(); + final int logRequired = payload.sizeof(); + assert logAvailable >= logRequired; + + logFile.appendBytes(payload.buffer(), payload.offset(), payload.sizeof()); + } + + public void writeEntryFinish( + ArrayFW headers, + KafkaDeltaType deltaType, EngineContext context, long traceId, long bindingId, @@ -489,9 +518,9 @@ public void writeEntryContinue( long offset, MutableInteger entryMark, MutableInteger valueMark, - OctetsFW payload, ConverterHandler convertValue, - boolean verbose) + boolean verbose, + List headerTypes) { final Node head = sentinel.previous; assert head != sentinel; @@ -500,15 +529,20 @@ public void writeEntryContinue( assert headSegment != null; final KafkaCacheFile logFile = headSegment.logFile(); + final KafkaCacheFile deltaFile = headSegment.deltaFile(); + final KafkaCacheFile hashFile = headSegment.hashFile(); + final KafkaCacheFile indexFile = headSegment.indexFile(); final KafkaCacheFile convertedFile = headSegment.convertedFile(); + final int valueLength = logFile.capacity() - valueMark.value; + final int logAvailable = logFile.available(); - final int logRequired = payload.sizeof(); - assert logAvailable >= logRequired; + final int logRequired = headers.sizeof(); + assert logAvailable >= logRequired : String.format("%s %d >= %d", headSegment, logAvailable, logRequired); - logFile.appendBytes(payload.buffer(), payload.offset(), payload.sizeof()); + Array32FW trailers = EMPTY_TRAILERS; - if (payload != null && convertValue != ConverterHandler.NONE) + if (valueLength != -1 && convertValue != ConverterHandler.NONE) { final ValueConsumer consumeConverted = (buffer, index, length) -> { @@ -524,10 +558,9 @@ public void writeEntryContinue( convertedFile.writeInt(convertedValueLimit + length, convertedPadding - length); }; - final int valueLength = logFile.capacity() - valueMark.value; int entryFlags = logFile.readInt(entryMark.value + FIELD_OFFSET_FLAGS); - if ((flags & FLAGS_FIN) != 0x00 && (entryFlags & CACHE_ENTRY_FLAGS_ABORTED) == 0x00) + if ((entryFlags & CACHE_ENTRY_FLAGS_ABORTED) == 0x00) { int converted = convertValue.convert(traceId, bindingId, logFile.buffer(), valueMark.value, valueLength, consumeConverted); @@ -541,31 +574,29 @@ public void writeEntryContinue( context.supplyLocalName(bindingId), topic, id, offset); } } + else if (headerTypes != null && !headerTypes.isEmpty()) + { + Array32FW.Builder builder = + trailersRW.wrap(trailersRW.buffer(), 0, trailersRW.maxLimit()); + for (KafkaTopicHeaderType header : headerTypes) + { + String32FW name = header.name; + String path = header.path; + builder.item(h -> + { + h.nameLen(name.length()) + .name(name.value(), 0, name.length()) + .valueLen(convertValue.extractedLength(path)); + convertValue.extracted(path, h::value); + }); + } + trailers = builder.build(); + } } } - } - - public void writeEntryFinish( - ArrayFW headers, - KafkaDeltaType deltaType) - { - final Node head = sentinel.previous; - assert head != sentinel; - - final KafkaCacheSegment headSegment = head.segment; - assert headSegment != null; - - final KafkaCacheFile logFile = headSegment.logFile(); - final KafkaCacheFile deltaFile = headSegment.deltaFile(); - final KafkaCacheFile hashFile = headSegment.hashFile(); - final KafkaCacheFile indexFile = headSegment.indexFile(); - - final int logAvailable = logFile.available(); - final int logRequired = headers.sizeof(); - assert logAvailable >= logRequired : String.format("%s %d >= %d", headSegment, logAvailable, logRequired); logFile.appendBytes(headers); - logFile.appendBytes(EMPTY_TRAILERS); + logFile.appendBytes(trailers); logFile.appendInt(0); final long offsetDelta = (int)(progress - headSegment.baseOffset()); @@ -585,6 +616,20 @@ public void writeEntryFinish( }); } + if (!trailers.isEmpty()) + { + final DirectBuffer buffer = trailers.buffer(); + final ByteBuffer byteBuffer = buffer.byteBuffer(); + assert byteBuffer != null; + byteBuffer.clear(); + trailers.forEach(t -> + { + final long hash = computeHash(t); + final long hashEntry = (hash << 32) | logFile.markValue(); + hashFile.appendLong(hashEntry); + }); + } + assert indexFile.available() >= Long.BYTES; indexFile.appendLong(indexEntry); diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/config/KafkaTopicConfigAdapter.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/config/KafkaTopicConfigAdapter.java index d34384b04b..0602263d7f 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/config/KafkaTopicConfigAdapter.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/config/KafkaTopicConfigAdapter.java @@ -17,14 +17,18 @@ import static jakarta.json.JsonValue.ValueType.OBJECT; +import java.util.Map; + import jakarta.json.Json; import jakarta.json.JsonObject; import jakarta.json.JsonObjectBuilder; +import jakarta.json.JsonString; import jakarta.json.JsonValue; import jakarta.json.bind.adapter.JsonbAdapter; import io.aklivity.zilla.runtime.binding.kafka.config.KafkaTopicConfig; import io.aklivity.zilla.runtime.binding.kafka.config.KafkaTopicConfigBuilder; +import io.aklivity.zilla.runtime.binding.kafka.config.KafkaTopicHeaderType; import io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaDeltaType; import io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaOffsetType; import io.aklivity.zilla.runtime.engine.config.ModelConfigAdapter; @@ -37,6 +41,7 @@ public final class KafkaTopicConfigAdapter implements JsonbAdapter entry : headers.entrySet()) + { + JsonString jsonString = (JsonString) entry.getValue(); + topicBuilder.header(entry.getKey(), jsonString.getString()); + } + } + return topicBuilder.build(); } } diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/config/KafkaTopicType.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/config/KafkaTopicType.java index cf217c1f58..7e58781eef 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/config/KafkaTopicType.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/config/KafkaTopicType.java @@ -15,11 +15,14 @@ */ package io.aklivity.zilla.runtime.binding.kafka.internal.config; +import java.util.ArrayList; +import java.util.List; import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; import io.aklivity.zilla.runtime.binding.kafka.config.KafkaTopicConfig; +import io.aklivity.zilla.runtime.binding.kafka.config.KafkaTopicHeaderType; import io.aklivity.zilla.runtime.engine.EngineContext; import io.aklivity.zilla.runtime.engine.model.ConverterHandler; @@ -31,6 +34,7 @@ public class KafkaTopicType public final ConverterHandler keyWriter; public final ConverterHandler valueReader; public final ConverterHandler valueWriter; + public final List headers; private final Matcher topicMatch; @@ -41,6 +45,7 @@ private KafkaTopicType() this.keyWriter = ConverterHandler.NONE; this.valueReader = ConverterHandler.NONE; this.valueWriter = ConverterHandler.NONE; + this.headers = new ArrayList<>(); } public KafkaTopicType( @@ -48,14 +53,17 @@ public KafkaTopicType( KafkaTopicConfig topicConfig) { this.topicMatch = topicConfig.name != null ? asMatcher(topicConfig.name) : null; + this.headers = topicConfig.headers; this.keyReader = Optional.ofNullable(topicConfig.key) .map(context::supplyReadConverter) + .map(this::headers) .orElse(ConverterHandler.NONE); this.keyWriter = Optional.ofNullable(topicConfig.key) .map(context::supplyWriteConverter) .orElse(ConverterHandler.NONE); this.valueReader = Optional.ofNullable(topicConfig.value) .map(context::supplyReadConverter) + .map(this::headers) .orElse(ConverterHandler.NONE); this.valueWriter = Optional.ofNullable(topicConfig.value) .map(context::supplyWriteConverter) @@ -68,6 +76,16 @@ public boolean matches( return this.topicMatch == null || this.topicMatch.reset(topic).matches(); } + private ConverterHandler headers( + ConverterHandler handler) + { + for (KafkaTopicHeaderType header : headers) + { + handler.extract(header.path); + } + return handler; + } + private static Matcher asMatcher( String topic) { diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaCacheClientFetchFactory.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaCacheClientFetchFactory.java index e606945e41..016356512f 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaCacheClientFetchFactory.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaCacheClientFetchFactory.java @@ -1256,6 +1256,7 @@ private void doClientReplyData( final int entryFlags = nextEntry.flags(); final KafkaKeyFW key = nextEntry.key(); final ArrayFW headers = nextEntry.headers(); + final ArrayFW trailers = nextEntry.trailers(); final long ancestor = nextEntry.ancestor(); final OctetsFW value = nextEntry.value(); final int remaining = value != null ? value.sizeof() - messageOffset : 0; @@ -1323,11 +1324,11 @@ private void doClientReplyData( switch (flags & ~FLAG_SKIP) { case FLAG_INIT | FLAG_FIN: - doClientReplyDataFull(traceId, timestamp, ownerId, filters, key, headers, deltaType, ancestor, fragment, - reserved, flags, partitionId, partitionOffset, stableOffset, latestOffset); + doClientReplyDataFull(traceId, timestamp, ownerId, filters, key, headers, trailers, deltaType, ancestor, + fragment, reserved, flags, partitionId, partitionOffset, stableOffset, latestOffset); break; case FLAG_INIT: - doClientReplyDataInit(traceId, headers, deferred, timestamp, ownerId, filters, key, deltaType, + doClientReplyDataInit(traceId, headers, trailers, deferred, timestamp, ownerId, filters, key, deltaType, ancestor, fragment, reserved, length, flags, partitionId, partitionOffset, stableOffset, latestOffset); break; @@ -1335,7 +1336,7 @@ private void doClientReplyData( doClientReplyDataNone(traceId, fragment, reserved, length, flags); break; case FLAG_FIN: - doClientReplyDataFin(traceId, headers, deltaType, ancestor, fragment, + doClientReplyDataFin(traceId, headers, trailers, deltaType, ancestor, fragment, reserved, length, flags, partitionId, partitionOffset, stableOffset, latestOffset); break; } @@ -1365,6 +1366,7 @@ private void doClientReplyDataFull( long filters, KafkaKeyFW key, ArrayFW headers, + ArrayFW trailers, KafkaDeltaType deltaType, long ancestorOffset, OctetsFW value, @@ -1390,10 +1392,11 @@ private void doClientReplyDataFull( .value(key.value())) .delta(d -> d.type(t -> t.set(deltaType)) .ancestorOffset(ancestorOffset)) - .headers(hs -> headers.forEach(h -> hs.item(i -> i.nameLen(h.nameLen()) - .name(h.name()) - .valueLen(h.valueLen()) - .value(h.value()))))) + .headers(hs -> + { + headers.forEach(h -> hs.item(i -> i.set(h))); + trailers.forEach(t -> hs.item(i -> i.set(t))); + })) .build() .sizeof())); @@ -1405,6 +1408,7 @@ private void doClientReplyDataFull( private void doClientReplyDataInit( long traceId, ArrayFW headers, + ArrayFW trailers, int deferred, long timestamp, long producerId, @@ -1437,10 +1441,11 @@ private void doClientReplyDataInit( .value(key.value())) .delta(d -> d.type(t -> t.set(deltaType)) .ancestorOffset(ancestorOffset)) - .headers(hs -> headers.forEach(h -> hs.item(i -> i.nameLen(h.nameLen()) - .name(h.name()) - .valueLen(h.valueLen()) - .value(h.value()))))) + .headers(hs -> + { + headers.forEach(h -> hs.item(i -> i.set(h))); + trailers.forEach(t -> hs.item(i -> i.set(t))); + })) .build() .sizeof())); @@ -1467,6 +1472,7 @@ private void doClientReplyDataNone( private void doClientReplyDataFin( long traceId, ArrayFW headers, + ArrayFW trailers, KafkaDeltaType deltaType, long ancestorOffset, OctetsFW fragment, @@ -1488,10 +1494,11 @@ private void doClientReplyDataFin( .latestOffset(latestOffset)) .delta(d -> d.type(t -> t.set(deltaType)) .ancestorOffset(ancestorOffset)) - .headers(hs -> headers.forEach(h -> hs.item(i -> i.nameLen(h.nameLen()) - .name(h.name()) - .valueLen(h.valueLen()) - .value(h.value()))))) + .headers(hs -> + { + headers.forEach(h -> hs.item(i -> i.set(h))); + trailers.forEach(t -> hs.item(i -> i.set(t))); + })) .build() .sizeof())); diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaCacheServerFetchFactory.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaCacheServerFetchFactory.java index e1d35853ad..1e867cda45 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaCacheServerFetchFactory.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaCacheServerFetchFactory.java @@ -42,6 +42,7 @@ import org.agrona.collections.MutableInteger; import org.agrona.concurrent.UnsafeBuffer; +import io.aklivity.zilla.runtime.binding.kafka.config.KafkaTopicHeaderType; import io.aklivity.zilla.runtime.binding.kafka.internal.KafkaBinding; import io.aklivity.zilla.runtime.binding.kafka.internal.KafkaConfiguration; import io.aklivity.zilla.runtime.binding.kafka.internal.cache.KafkaCache; @@ -482,6 +483,7 @@ final class KafkaCacheServerFetchFanout private final ConverterHandler convertValue; private final MutableInteger entryMark; private final MutableInteger valueMark; + private final List headerTypes; private long leaderId; private long initialId; @@ -531,6 +533,7 @@ private KafkaCacheServerFetchFanout( this.convertValue = topicType.valueReader; this.entryMark = new MutableInteger(0); this.valueMark = new MutableInteger(0); + this.headerTypes = topicType.headers; } private void onServerFanoutMemberOpening( @@ -776,7 +779,7 @@ private void onServerFanoutReplyFlush( partition.writeEntry(context, traceId, routedId, partitionOffset, entryMark, valueMark, 0L, producerId, EMPTY_KEY, EMPTY_HEADERS, EMPTY_OCTETS, null, - entryFlags, KafkaDeltaType.NONE, convertKey, convertValue, verbose); + entryFlags, KafkaDeltaType.NONE, convertKey, convertValue, verbose, headerTypes); if (result == KafkaTransactionResult.ABORT) { @@ -885,8 +888,7 @@ private void onServerFanoutReplyData( if (valueFragment != null) { - partition.writeEntryContinue(context, traceId, routedId, flags, partitionOffset, entryMark, valueMark, - valueFragment, convertValue, verbose); + partition.writeEntryContinue(valueFragment); } if ((flags & FLAGS_FIN) != 0x00) @@ -905,7 +907,8 @@ private void onServerFanoutReplyData( assert partitionId == partition.id(); assert partitionOffset >= this.partitionOffset; - partition.writeEntryFinish(headers, deltaType); + partition.writeEntryFinish(headers, deltaType, context, traceId, routedId, flags, partitionOffset, + entryMark, valueMark, convertValue, verbose, headerTypes); this.partitionOffset = partitionOffset; this.stableOffset = stableOffset; diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaCacheServerProduceFactory.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaCacheServerProduceFactory.java index a80800b60d..dd3f320061 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaCacheServerProduceFactory.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaCacheServerProduceFactory.java @@ -1254,7 +1254,7 @@ private void doProduceInitialData( doServerInitialDataNone(traceId, fragment, reserved, length, flags); break; case FLAG_FIN: - doServerInitialDataFin(traceId, headers, fragment, reserved, flags); + doServerInitialDataFin(traceId, headers, trailers, fragment, reserved, flags); break; } @@ -1311,7 +1311,7 @@ private void doServerInitialDataFull( .headers(hs -> { headers.forEach(h -> hs.item(i -> i.set(h))); - trailers.forEach(h -> hs.item(i -> i.set(h))); + trailers.forEach(t -> hs.item(i -> i.set(t))); })) .build() .sizeof())); @@ -1347,7 +1347,7 @@ private void doServerInitialDataInit( .headers(hs -> { headers.forEach(h -> hs.item(i -> i.set(h))); - trailers.forEach(h -> hs.item(i -> i.set(h))); + trailers.forEach(t -> hs.item(i -> i.set(t))); })) .build() .sizeof())); @@ -1366,6 +1366,7 @@ private void doServerInitialDataNone( private void doServerInitialDataFin( long traceId, ArrayFW headers, + ArrayFW trailers, OctetsFW fragment, int reserved, int flags) @@ -1373,10 +1374,13 @@ private void doServerInitialDataFin( fan.doServerFanInitialData(traceId, flags, 0L, reserved, fragment, ex -> ex.set((b, o, l) -> kafkaDataExRW.wrap(b, o, l) .typeId(kafkaTypeId) - .produce(f -> f.headers(hs -> headers.forEach(h -> hs.item(i -> i.nameLen(h.nameLen()) - .name(h.name()) - .valueLen(h.valueLen()) - .value(h.value()))))) + .produce(f -> f + .headers(hs -> + { + headers.forEach(h -> hs.item(i -> i.set(h))); + trailers.forEach(t -> hs.item(i -> i.set(t))); + } + )) .build() .sizeof())); } diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaMergedFactory.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaMergedFactory.java index 21c91c6eb3..f10915487b 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaMergedFactory.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/KafkaMergedFactory.java @@ -3645,8 +3645,7 @@ private void onFetchInitialReset( state = KafkaState.closedInitial(state); final KafkaResetExFW kafkaResetEx = extension.get(kafkaResetExRO::tryWrap); - final int defaultError = KafkaState.replyClosed(state) ? ERROR_NOT_LEADER_FOR_PARTITION : -1; - final int error = kafkaResetEx != null ? kafkaResetEx.error() : defaultError; + final int error = kafkaResetEx != null ? kafkaResetEx.error() : -1; doFetchReplyResetIfNecessary(traceId); diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/cache/KafkaCachePartitionTest.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/cache/KafkaCachePartitionTest.java index 9c7cf45248..0c3f8c9ea0 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/cache/KafkaCachePartitionTest.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/cache/KafkaCachePartitionTest.java @@ -229,13 +229,15 @@ public void shouldCleanSegment() throws Exception KafkaCacheSegment head10s = head10.segment(); partition.writeEntry(null, 1L, 1L, 11L, entryMark, valueMark, 0L, -1L, - key, headers, value, null, 0x00, KafkaDeltaType.NONE, ConverterHandler.NONE, ConverterHandler.NONE, false); + key, headers, value, null, 0x00, KafkaDeltaType.NONE, ConverterHandler.NONE, + ConverterHandler.NONE, false, null); long keyHash = partition.computeKeyHash(key); KafkaCacheEntryFW ancestor = head10.findAndMarkAncestor(key, keyHash, 11L, ancestorRO); partition.writeEntry(null, 1L, 1L, 12L, entryMark, valueMark, 0L, -1L, - key, headers, value, ancestor, 0x00, KafkaDeltaType.NONE, ConverterHandler.NONE, ConverterHandler.NONE, false); + key, headers, value, ancestor, 0x00, KafkaDeltaType.NONE, ConverterHandler.NONE, + ConverterHandler.NONE, false, null); Node head15 = partition.append(15L); KafkaCacheSegment head15s = head15.segment(); @@ -285,13 +287,15 @@ public void shouldSeekAncestor() throws Exception Node head10 = partition.append(10L); partition.writeEntry(null, 1L, 1L, 11L, entryMark, valueMark, 0L, -1L, - key, headers, value, null, 0x00, KafkaDeltaType.NONE, ConverterHandler.NONE, ConverterHandler.NONE, false); + key, headers, value, null, 0x00, KafkaDeltaType.NONE, ConverterHandler.NONE, + ConverterHandler.NONE, false, null); long keyHash = partition.computeKeyHash(key); KafkaCacheEntryFW ancestor = head10.findAndMarkAncestor(key, keyHash, 11L, ancestorRO); partition.writeEntry(null, 1L, 1L, 12L, entryMark, valueMark, 0L, -1L, - key, headers, value, ancestor, 0x00, KafkaDeltaType.NONE, ConverterHandler.NONE, ConverterHandler.NONE, false); + key, headers, value, ancestor, 0x00, KafkaDeltaType.NONE, ConverterHandler.NONE, + ConverterHandler.NONE, false, null); Node head15 = partition.append(15L); Node tail10 = head15.previous(); diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/config/KafkaOptionsConfigAdapterTest.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/config/KafkaOptionsConfigAdapterTest.java index d87d2c7137..268c0834fa 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/config/KafkaOptionsConfigAdapterTest.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/config/KafkaOptionsConfigAdapterTest.java @@ -22,6 +22,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.nullValue; +import static org.junit.Assert.assertEquals; import jakarta.json.bind.Jsonb; import jakarta.json.bind.JsonbBuilder; @@ -213,4 +214,52 @@ public void shouldWriteCatalogOptions() "\"servers\":[\"localhost:9092\"]," + "\"sasl\":{\"mechanism\":\"plain\",\"username\":\"username\",\"password\":\"password\"}}")); } + + @Test + public void shouldReadHeadersOptions() + { + String text = + "{" + + "\"bootstrap\":" + + "[" + + "\"test\"" + + "]," + + "\"topics\":" + + "[" + + "{" + + "\"name\": \"test\"," + + "\"headers\":" + + "{" + + "\"correlation-id\": \"${message.value.correlationId}\"" + + "}" + + "}" + + "]" + + "}"; + + KafkaOptionsConfig options = jsonb.fromJson(text, KafkaOptionsConfig.class); + + assertThat(options, not(nullValue())); + assertThat(options.bootstrap, equalTo(singletonList("test"))); + assertEquals(options.topics.get(0).headers.get(0).name.asString(), "correlation-id"); + assertEquals(options.topics.get(0).headers.get(0).path, "$.correlationId"); + } + + @Test + public void shouldWriteHeadersOptions() + { + KafkaOptionsConfig options = KafkaOptionsConfig.builder() + .bootstrap(singletonList("test")) + .topics(singletonList(KafkaTopicConfig.builder() + .name("test") + .header("correlation-id", "${message.value.correlationId}") + .value(TestModelConfig.builder().length(0).build()) + .build())) + .build(); + + String text = jsonb.toJson(options); + + assertThat(text, not(nullValue())); + assertThat(text, equalTo("{\"bootstrap\":[\"test\"]," + + "\"topics\":[{\"name\":\"test\",\"value\":\"test\",\"headers\":{\"correlation-id\":\"$.correlationId\"}}]}")); + } } diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheBootstrapIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheBootstrapIT.java index d55e94a547..9e7d86a1ad 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheBootstrapIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheBootstrapIT.java @@ -27,9 +27,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheConsumerIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheConsumerIT.java index 5721123d3e..3c4e641002 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheConsumerIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheConsumerIT.java @@ -23,10 +23,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheDescribeIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheDescribeIT.java index de23eedc2e..52e493ff37 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheDescribeIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheDescribeIT.java @@ -27,10 +27,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheFetchIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheFetchIT.java index b2f9e00260..2bad78a286 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheFetchIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheFetchIT.java @@ -31,10 +31,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.kafka.internal.KafkaBinding; import io.aklivity.zilla.runtime.binding.kafka.internal.cache.KafkaCache; import io.aklivity.zilla.runtime.binding.kafka.internal.cache.KafkaCachePartition; @@ -535,6 +535,21 @@ public void shouldReceiveMessagesWithHeaderFilter() throws Exception k3po.finish(); } + @Test + @Configuration("cache.options.extract.headers.yaml") + @Specification({ + "${app}/filter.extracted.header/client", + "${app}/filter.none/server"}) + @ScriptProperty("serverAddress \"zilla://streams/app1\"") + public void shouldReceiveMessagesWithExtractedHeaderFilter() throws Exception + { + partition.append(1L); + k3po.start(); + k3po.awaitBarrier("RECEIVED_MESSAGE_2"); + k3po.notifyBarrier("SEND_MESSAGE_3"); + k3po.finish(); + } + @Test @Configuration("cache.yaml") @Specification({ diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheGroupIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheGroupIT.java index 85a2959cdc..b06a4b89eb 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheGroupIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheGroupIT.java @@ -26,10 +26,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheMergedIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheMergedIT.java index 9708c0ce06..6b52c061e3 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheMergedIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheMergedIT.java @@ -29,9 +29,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.kafka.internal.KafkaConfigurationTest; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheMetaIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheMetaIT.java index 90325d19ab..e1eeb92bcd 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheMetaIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheMetaIT.java @@ -27,10 +27,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheOffsetCommitIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheOffsetCommitIT.java index 209b49b3a4..5bccbf0844 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheOffsetCommitIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheOffsetCommitIT.java @@ -26,10 +26,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheOffsetFetchIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheOffsetFetchIT.java index 8b8669a5cd..8a4ce37c50 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheOffsetFetchIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheOffsetFetchIT.java @@ -26,10 +26,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheProduceIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheProduceIT.java index 7c9503eb0f..1a38c90cc1 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheProduceIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/CacheProduceIT.java @@ -30,10 +30,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientDescribeIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientDescribeIT.java index 697dd4324c..9f06354557 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientDescribeIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientDescribeIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientDescribeSaslIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientDescribeSaslIT.java index feef221e5c..c7d4655aa0 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientDescribeSaslIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientDescribeSaslIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientFetchIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientFetchIT.java index 4c136d3e4f..dca84640f3 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientFetchIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientFetchIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientFetchSaslIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientFetchSaslIT.java index d9bb13cad2..b23d6ebf3a 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientFetchSaslIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientFetchSaslIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientGroupIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientGroupIT.java index ae7bc5c3c7..b9cdddffd1 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientGroupIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientGroupIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientGroupSaslIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientGroupSaslIT.java index 2255565b64..b1581b1003 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientGroupSaslIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientGroupSaslIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientInitProducerIdIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientInitProducerIdIT.java index 44f780f4e1..ac44ff6e43 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientInitProducerIdIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientInitProducerIdIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientInitProducerIdSaslIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientInitProducerIdSaslIT.java index 723c93b22d..56a08fa390 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientInitProducerIdSaslIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientInitProducerIdSaslIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientMergedIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientMergedIT.java index 7803a7ce1f..1d5fdbaa6d 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientMergedIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientMergedIT.java @@ -28,10 +28,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientMetaIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientMetaIT.java index ddd5b9fe47..c60d950b41 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientMetaIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientMetaIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientMetaSaslIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientMetaSaslIT.java index 75501b13a4..b6cc25e9e2 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientMetaSaslIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientMetaSaslIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetCommitIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetCommitIT.java index b0d8a6f3c6..f32526dd29 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetCommitIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetCommitIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetCommitSaslIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetCommitSaslIT.java index 369f95f56f..ffb64457e9 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetCommitSaslIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetCommitSaslIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetFetchIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetFetchIT.java index 7fb0d893cc..5c0d5434a9 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetFetchIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetFetchIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetFetchSaslIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetFetchSaslIT.java index 8c4bbc4b20..45b813d0fd 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetFetchSaslIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientOffsetFetchSaslIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientProduceIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientProduceIT.java index 4de16afec5..3d71429543 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientProduceIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientProduceIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.kafka.internal.KafkaConfigurationTest; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientProduceSaslIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientProduceSaslIT.java index 818f5d7c47..ad093086cf 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientProduceSaslIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/ClientProduceSaslIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/EventIT.java b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/EventIT.java index e62066ce95..c522c718ae 100644 --- a/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/EventIT.java +++ b/runtime/binding-kafka/src/test/java/io/aklivity/zilla/runtime/binding/kafka/internal/stream/EventIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-mqtt-kafka/pom.xml b/runtime/binding-mqtt-kafka/pom.xml index 242fab6cbf..6c007d305d 100644 --- a/runtime/binding-mqtt-kafka/pom.xml +++ b/runtime/binding-mqtt-kafka/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.89 0 @@ -76,13 +74,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -177,7 +175,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/config/MqttKafkaOptionsConfig.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/config/MqttKafkaOptionsConfig.java index 4c60c7c599..3ca5436b2b 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/config/MqttKafkaOptionsConfig.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/config/MqttKafkaOptionsConfig.java @@ -24,6 +24,7 @@ public class MqttKafkaOptionsConfig extends OptionsConfig public final MqttKafkaTopicsConfig topics; public final String serverRef; public final List clients; + public final MqttKafkaPublishConfig publish; public static MqttKafkaOptionsConfigBuilder builder() { @@ -39,10 +40,12 @@ public static MqttKafkaOptionsConfigBuilder builder( MqttKafkaOptionsConfig( MqttKafkaTopicsConfig topics, String serverRef, - List clients) + List clients, + MqttKafkaPublishConfig publish) { this.topics = topics; this.serverRef = serverRef; this.clients = clients; + this.publish = publish; } } diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/config/MqttKafkaOptionsConfigBuilder.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/config/MqttKafkaOptionsConfigBuilder.java index f1fc734608..d0cff89068 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/config/MqttKafkaOptionsConfigBuilder.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/config/MqttKafkaOptionsConfigBuilder.java @@ -27,6 +27,7 @@ public class MqttKafkaOptionsConfigBuilder extends ConfigBuilder clients; + private MqttKafkaPublishConfig publish; MqttKafkaOptionsConfigBuilder( Function mapper) @@ -68,10 +69,22 @@ public MqttKafkaOptionsConfigBuilder clients( return this; } + public MqttKafkaOptionsConfigBuilder publish( + MqttKafkaPublishConfig publish) + { + this.publish = publish; + return this; + } + + public MqttKafkaPublishConfigBuilder> publish() + { + return new MqttKafkaPublishConfigBuilder<>(this::publish); + } + @Override public T build() { - return mapper.apply(new MqttKafkaOptionsConfig(topics, serverRef, clients)); + return mapper.apply(new MqttKafkaOptionsConfig(topics, serverRef, clients, publish)); } } diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/config/MqttKafkaPublishConfig.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/config/MqttKafkaPublishConfig.java new file mode 100644 index 0000000000..92f84575d5 --- /dev/null +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/config/MqttKafkaPublishConfig.java @@ -0,0 +1,42 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.binding.mqtt.kafka.config; + +import java.util.function.Function; + +import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.MqttQoS; + +public class MqttKafkaPublishConfig +{ + public final MqttQoS qosMax; + + public static MqttKafkaPublishConfigBuilder builder() + { + return new MqttKafkaPublishConfigBuilder<>(MqttKafkaPublishConfig.class::cast); + } + + public static MqttKafkaPublishConfigBuilder builder( + Function mapper) + { + return new MqttKafkaPublishConfigBuilder<>(mapper); + } + + MqttKafkaPublishConfig( + MqttQoS qosMax) + { + this.qosMax = qosMax; + } +} + diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/config/MqttKafkaPublishConfigBuilder.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/config/MqttKafkaPublishConfigBuilder.java new file mode 100644 index 0000000000..3a1e4bd8cc --- /dev/null +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/config/MqttKafkaPublishConfigBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.binding.mqtt.kafka.config; + +import java.util.function.Function; + +import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.MqttQoS; +import io.aklivity.zilla.runtime.engine.config.ConfigBuilder; + +public class MqttKafkaPublishConfigBuilder extends ConfigBuilder> +{ + private final Function mapper; + + private MqttQoS qosMax; + + MqttKafkaPublishConfigBuilder( + Function mapper) + { + this.mapper = mapper; + } + + @Override + @SuppressWarnings("unchecked") + protected Class> thisType() + { + return (Class>) getClass(); + } + + + public MqttKafkaPublishConfigBuilder qosMax( + String qosMax) + { + this.qosMax = MqttQoS.valueOf(qosMax.toUpperCase()); + return this; + } + + + @Override + public T build() + { + return mapper.apply(new MqttKafkaPublishConfig(qosMax)); + } +} diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/InstanceId.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/InstanceId.java index fcb5bc86ca..bcdd4450aa 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/InstanceId.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/InstanceId.java @@ -18,7 +18,6 @@ import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.String16FW; - public class InstanceId { private final Supplier supplyInstanceId; diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java index f62228de03..28c595dcd0 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java @@ -53,13 +53,13 @@ public MqttKafkaEventContext( public void onMqttConnectionReset( long traceId, long bindingId, - String16FW reason) + String16FW topic) { MqttKafkaEventExFW extension = mqttKafkaEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) .nonCompactSessionsTopic(e -> e .typeId(NON_COMPACT_SESSIONS_TOPIC.value()) - .reason(reason)) + .topic(topic)) .build(); EventFW event = eventRW .wrap(eventBuffer, 0, eventBuffer.capacity()) diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java index 8c66ebbe31..d8163664fd 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java @@ -19,14 +19,12 @@ import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.String16FW; import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.EventFW; import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.MqttKafkaEventExFW; -import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.MqttKafkaResetMqttConnectionExFW; +import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.MqttKafkaNonCompactSessionsTopicExFW; import io.aklivity.zilla.runtime.engine.Configuration; import io.aklivity.zilla.runtime.engine.event.EventFormatterSpi; public final class MqttKafkaEventFormatter implements EventFormatterSpi { - private static final String NON_COMPACT_SESSIONS_TOPIC_FORMAT = "NON COMPACT SESSIONS TOPIC - %s"; - private final EventFW eventRO = new EventFW(); private final MqttKafkaEventExFW mqttKafkaEventExRO = new MqttKafkaEventExFW(); @@ -48,8 +46,11 @@ public String format( { case NON_COMPACT_SESSIONS_TOPIC: { - MqttKafkaResetMqttConnectionExFW ex = extension.nonCompactSessionsTopic(); - result = String.format(NON_COMPACT_SESSIONS_TOPIC_FORMAT, asString(ex.reason())); + MqttKafkaNonCompactSessionsTopicExFW ex = extension.nonCompactSessionsTopic(); + result = String.format( + "The sessions topic (%s) is not log compacted. Update the cleanup policy to enable log compaction.", + asString(ex.topic()) + ); break; } } diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/config/MqttKafkaBindingConfig.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/config/MqttKafkaBindingConfig.java index 855ee3fdd1..50eac8e10a 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/config/MqttKafkaBindingConfig.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/config/MqttKafkaBindingConfig.java @@ -14,6 +14,7 @@ */ package io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.config; +import static io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.MqttQoS.AT_LEAST_ONCE; import static java.util.stream.Collectors.toList; import java.util.ArrayList; @@ -23,7 +24,6 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; - import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaConditionKind; import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaOptionsConfig; import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaRouteConfig; @@ -99,7 +99,7 @@ public List resolveAll( public MqttQoS publishQosMax() { return routes.stream().noneMatch(r -> r.with != null && r.with.containsParams()) ? - MqttQoS.EXACTLY_ONCE : MqttQoS.AT_LEAST_ONCE; + options.publish.qosMax : AT_LEAST_ONCE; } public String16FW messagesTopic() diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/config/MqttKafkaOptionsConfigAdapter.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/config/MqttKafkaOptionsConfigAdapter.java index bd6f9662d9..c87d1ccc5e 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/config/MqttKafkaOptionsConfigAdapter.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/config/MqttKafkaOptionsConfigAdapter.java @@ -27,8 +27,10 @@ import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaOptionsConfig; import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaOptionsConfigBuilder; +import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaPublishConfig; import io.aklivity.zilla.runtime.binding.mqtt.kafka.config.MqttKafkaTopicsConfig; import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.MqttKafkaBinding; +import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.MqttQoS; import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.String16FW; import io.aklivity.zilla.runtime.engine.config.OptionsConfig; import io.aklivity.zilla.runtime.engine.config.OptionsConfigAdapterSpi; @@ -41,6 +43,8 @@ public class MqttKafkaOptionsConfigAdapter implements OptionsConfigAdapterSpi, J private static final String SESSIONS_NAME = "sessions"; private static final String MESSAGES_NAME = "messages"; private static final String RETAINED_NAME = "retained"; + private static final String PUBLISH_NAME = "publish"; + private static final String QOS_MAX_NAME = "qosMax"; @Override public Kind kind() @@ -111,6 +115,7 @@ public OptionsConfig adaptFromJson( JsonObject topics = object.getJsonObject(TOPICS_NAME); options.serverRef(object.getString(SERVER_NAME, null)); JsonArray clientsJson = object.getJsonArray(CLIENTS_NAME); + JsonObject publish = object.getJsonObject(PUBLISH_NAME); List clients = new ArrayList<>(); if (clientsJson != null) @@ -128,6 +133,17 @@ public OptionsConfig adaptFromJson( .retained(topics.getString(RETAINED_NAME)) .build()); + if (publish != null) + { + options.publish(MqttKafkaPublishConfig.builder() + .qosMax(publish.getString(QOS_MAX_NAME)).build()); + } + else + { + options.publish(MqttKafkaPublishConfig.builder() + .qosMax(MqttQoS.EXACTLY_ONCE.name()).build()); + } + return options.build(); } } diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java index 7ab987ddba..ca08f97a61 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java @@ -121,6 +121,7 @@ import io.aklivity.zilla.runtime.engine.buffer.BufferPool; import io.aklivity.zilla.runtime.engine.concurrent.Signaler; + public class MqttKafkaSessionFactory implements MqttKafkaStreamFactory { private static final byte SLASH_BYTE = (byte) '/'; @@ -170,7 +171,6 @@ public class MqttKafkaSessionFactory implements MqttKafkaStreamFactory public static final int MQTT_NOT_AUTHORIZED = 0x87; public static final int MQTT_IMPLEMENTATION_SPECIFIC_ERROR = 0x83; public static final String MQTT_INVALID_SESSION_TIMEOUT_REASON = "Invalid session expiry interval"; - public static final String16FW MQTT_NON_COMPACT_SESSIONS_TOPIC = new String16FW("Sessions Kafka topic in non-compacted"); private static final KafkaConfigFW CONFIG_COMPACT_CLEANUP_POLICY = new KafkaConfigFW.Builder() .wrap(new UnsafeBuffer(new byte[25]), 0, 25) .name("cleanup.policy") @@ -3469,7 +3469,8 @@ protected void onKafkaBegin( .build(); delegate.doMqttWindow(authorization, traceId, 0, 0, 0); delegate.doMqttReset(traceId, mqttResetEx); - events.onMqttConnectionReset(traceId, routedId, MQTT_NON_COMPACT_SESSIONS_TOPIC); + events.onMqttConnectionReset(traceId, routedId, delegate.sessionsTopic); + doKafkaWindow(traceId, authorization, 0, 0, 0, 0, 0); doKafkaAbort(traceId, authorization); break onKafkaBegin; } @@ -3630,6 +3631,20 @@ protected void doKafkaBegin( delegate.sessionId, server, capabilities); } + private void doKafkaWindow( + long traceId, + long authorization, + long budgetId, + int capabilities, + long replySeq, + long replyAck, + int replyMax) + { + + doWindow(kafka, originId, routedId, replyId, replySeq, replyAck, replyMax, + traceId, authorization, budgetId, replyPad, 0, capabilities); + } + private void cancelWillSignal( long authorization, long traceId) diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSubscribeFactory.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSubscribeFactory.java index 956d8cf1a9..2a9bde770c 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSubscribeFactory.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSubscribeFactory.java @@ -109,7 +109,7 @@ public class MqttKafkaSubscribeFactory implements MqttKafkaStreamFactory private static final int DATA_FLAG_FIN = 0x01; private static final OctetsFW EMPTY_OCTETS = new OctetsFW().wrap(new UnsafeBuffer(new byte[0]), 0, 0); private static final String16FW EMPTY_STRING = new String16FW(""); - private static final int OFFSET_METADATA_VERSION = 1; + private static final int OFFSET_METADATA_VERSION = 2; private final OctetsFW emptyRO = new OctetsFW().wrap(new UnsafeBuffer(0L, 0), 0, 0); private final BeginFW beginRO = new BeginFW(); @@ -467,93 +467,118 @@ private void onMqttFlush( binding.resolveAll(authorization, filters) : null; final int packetId = mqttSubscribeFlushEx.packetId(); - if (!filters.isEmpty()) + if (!MqttKafkaState.replyClosed(state)) { - if (routes != null) + if (!filters.isEmpty()) { - routes.forEach(r -> - { - final long routeOrder = r.order; - if (!messages.containsKey(routeOrder)) - { - KafkaMessagesProxy messagesProxy = new KafkaMessagesProxy(originId, r, this); - messages.put(routeOrder, messagesProxy); - messagesPerTopicKey.put(messagesProxy.topicKey, r.order); - messagesProxy.doKafkaBegin(traceId, authorization, 0, filters); - } - else - { - messages.get(routeOrder).doKafkaFlush(traceId, authorization, budgetId, reserved, qos, filters); - } - }); + onFiltersChanged(traceId, authorization, budgetId, reserved, filters, routes); } - - if (retainAvailable) + else if (packetId > 0) { - final List retainedFilters = new ArrayList<>(); - filters.forEach(filter -> - { - final boolean sendRetained = (filter.flags() & SEND_RETAIN_FLAG) != 0; - if (sendRetained) - { - retainedFilters.add(new Subscription( - (int) filter.subscriptionId(), newString16FW(filter.pattern()), filter.qos(), filter.flags())); - final boolean rap = (filter.flags() & RETAIN_AS_PUBLISHED_FLAG) != 0; - retainAsPublished.put((int) filter.subscriptionId(), rap); - } - }); - - retainedSubscriptions.removeIf(rf -> !filters.anyMatch(f -> f.pattern().equals(rf.filter))); - if (!retainedFilters.isEmpty()) - { - if (MqttKafkaState.initialOpened(retained.state) && !MqttKafkaState.initialClosed(retained.state)) - { - retained.doKafkaFlush(traceId, authorization, budgetId, reserved, qos, retainedFilters); - } - else - { - final List newRetainedFilters = new ArrayList<>(); - retainedFilters.forEach(subscription -> - { - if (!retainedSubscriptions.contains(subscription)) - { - newRetainedFilters.add(subscription); - } - }); - retained.doKafkaBegin(traceId, authorization, 0, newRetainedFilters); - } - } + onMessageAcked(traceId, authorization, budgetId, reserved, packetId, mqttSubscribeFlushEx); } } - else if (packetId > 0) - { - final int qos = mqttSubscribeFlushEx.qos(); - final MqttOffsetStateFlags state = MqttOffsetStateFlags.valueOf(mqttSubscribeFlushEx.state()); - final PartitionOffset offset = state == MqttOffsetStateFlags.INCOMPLETE ? - offsetsPerPacketId.get(packetId) : offsetsPerPacketId.remove(packetId); + } + + private void onMessageAcked( + long traceId, + long authorization, + long budgetId, + int reserved, + int packetId, + MqttSubscribeFlushExFW mqttSubscribeFlushEx) + { + final int qos = mqttSubscribeFlushEx.qos(); + final MqttOffsetStateFlags state = MqttOffsetStateFlags.valueOf(mqttSubscribeFlushEx.state()); + final PartitionOffset offset = state == MqttOffsetStateFlags.INCOMPLETE ? + offsetsPerPacketId.get(packetId) : offsetsPerPacketId.remove(packetId); - final long topicPartitionKey = topicPartitionKey(offset.topicKey, offset.partitionId); - final long messagesId = messagesPerTopicKey.get(offset.topicKey); + final long topicPartitionKey = topicPartitionKey(offset.topicKey, offset.partitionId); + final long messagesId = messagesPerTopicKey.get(offset.topicKey); - OffsetCommit offsetCommit = new OffsetCommit(offset, qos, state, packetId); + OffsetCommit offsetCommit = new OffsetCommit(offset, qos, state, packetId); - final OffsetHighWaterMark highWaterMark = highWaterMarks.get(topicPartitionKey); + final OffsetHighWaterMark highWaterMark = highWaterMarks.get(topicPartitionKey); - final KafkaProxy proxy = messagesId != -1 ? messages.get(messagesId) : retained; + final KafkaProxy proxy = messagesId != -1 ? messages.get(messagesId) : retained; + + if (highWaterMark.offset >= offset.offset) + { + highWaterMark.increase(); + commitOffset(traceId, authorization, budgetId, reserved, proxy, offsetCommit); + commitDeferredOffsets(traceId, authorization, budgetId, reserved, highWaterMark); + } + else if (qos == MqttQoS.EXACTLY_ONCE.value() && state != MqttOffsetStateFlags.INCOMPLETE) + { + commitOffset(traceId, authorization, budgetId, reserved, proxy, offsetCommit); + } + else + { + highWaterMark.deferOffsetCommit(offsetCommit, proxy); + } + } - if (highWaterMark.offset >= offset.offset) + private void onFiltersChanged( + long traceId, + long authorization, + long budgetId, + int reserved, + Array32FW filters, + List routes) + { + if (routes != null) + { + routes.forEach(r -> { - highWaterMark.increase(); - commitOffset(traceId, authorization, budgetId, reserved, proxy, offsetCommit); - commitDeferredOffsets(traceId, authorization, budgetId, reserved, highWaterMark); - } - else if (qos == MqttQoS.EXACTLY_ONCE.value() && state != MqttOffsetStateFlags.INCOMPLETE) + final long routeOrder = r.order; + if (!messages.containsKey(routeOrder)) + { + KafkaMessagesProxy messagesProxy = new KafkaMessagesProxy(originId, r, this); + messages.put(routeOrder, messagesProxy); + messagesPerTopicKey.put(messagesProxy.topicKey, r.order); + messagesProxy.doKafkaBegin(traceId, authorization, 0, filters); + } + else + { + messages.get(routeOrder).doKafkaFlush(traceId, authorization, budgetId, reserved, qos, filters); + } + }); + } + + if (retainAvailable) + { + final List retainedFilters = new ArrayList<>(); + filters.forEach(filter -> { - commitOffset(traceId, authorization, budgetId, reserved, proxy, offsetCommit); - } - else + final boolean sendRetained = (filter.flags() & SEND_RETAIN_FLAG) != 0; + if (sendRetained) + { + retainedFilters.add(new Subscription((int) filter.subscriptionId(), + newString16FW(filter.pattern()), filter.qos(), filter.flags())); + final boolean rap = (filter.flags() & RETAIN_AS_PUBLISHED_FLAG) != 0; + retainAsPublished.put((int) filter.subscriptionId(), rap); + } + }); + + retainedSubscriptions.removeIf(rf -> !filters.anyMatch(f -> f.pattern().equals(rf.filter))); + if (!retainedFilters.isEmpty()) { - highWaterMark.deferOffsetCommit(offsetCommit, proxy); + if (MqttKafkaState.initialOpened(retained.state) && !MqttKafkaState.initialClosed(retained.state)) + { + retained.doKafkaFlush(traceId, authorization, budgetId, reserved, qos, retainedFilters); + } + else + { + final List newRetainedFilters = new ArrayList<>(); + retainedFilters.forEach(subscription -> + { + if (!retainedSubscriptions.contains(subscription)) + { + newRetainedFilters.add(subscription); + } + }); + retained.doKafkaBegin(traceId, authorization, 0, newRetainedFilters); + } } } } @@ -1846,7 +1871,16 @@ private IntArrayList stringToOffsetMetadataList( final IntArrayList metadataList = new IntArrayList(); UnsafeBuffer buffer = new UnsafeBuffer(BitUtil.fromHex(metadata.asString())); final MqttSubscribeOffsetMetadataFW offsetMetadata = mqttOffsetMetadataRO.wrap(buffer, 0, buffer.capacity()); - offsetMetadata.packetIds().forEachRemaining((IntConsumer) metadataList::add); + switch (offsetMetadata.kind()) + { + case V1: + offsetMetadata.subscribeMetadataV1().packetIds().forEachRemaining((IntConsumer) metadataList::add); + break; + case V2: + offsetMetadata.subscribeMetadataV2().packetIds().forEachRemaining((IntConsumer) metadataList::add); + break; + } + return metadataList; } @@ -1854,8 +1888,7 @@ private String16FW offsetMetadataListToString( IntArrayList metadataList) { mqttOffsetMetadataRW.wrap(offsetBuffer, 0, offsetBuffer.capacity()); - mqttOffsetMetadataRW.version(OFFSET_METADATA_VERSION); - metadataList.forEach(p -> mqttOffsetMetadataRW.appendPacketIds(p.shortValue())); + mqttOffsetMetadataRW.subscribeMetadataV2(m -> metadataList.forEach(p -> m.appendPacketIds(p.shortValue()))); final MqttSubscribeOffsetMetadataFW offsetMetadata = mqttOffsetMetadataRW.build(); return new String16FW(BitUtil.toHex(offsetMetadata.buffer().byteArray(), offsetMetadata.offset(), offsetMetadata.limit())); diff --git a/runtime/binding-mqtt-kafka/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaPublishProxyIT.java b/runtime/binding-mqtt-kafka/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaPublishProxyIT.java index d7e6a61c2a..2bffc2e7ad 100644 --- a/runtime/binding-mqtt-kafka/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaPublishProxyIT.java +++ b/runtime/binding-mqtt-kafka/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaPublishProxyIT.java @@ -28,9 +28,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; @@ -212,6 +212,17 @@ public void shouldRejectPublishWhenTopicSpaceWithParams() throws Exception k3po.finish(); } + @Test + @Configuration("proxy.publish.qos.max.yaml") + @Configure(name = WILL_AVAILABLE_NAME, value = "false") + @Specification({ + "${mqtt}/publish.reject.qos2/client", + "${kafka}/publish.reject.qos2/server"}) + public void shouldRejectPublishWhenQosMaxSet() throws Exception + { + k3po.finish(); + } + @Test @Configuration("proxy.when.client.topic.space.yaml") @Configure(name = WILL_AVAILABLE_NAME, value = "false") diff --git a/runtime/binding-mqtt-kafka/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionProxyIT.java b/runtime/binding-mqtt-kafka/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionProxyIT.java index 6808a4587b..2fd8f15ca8 100644 --- a/runtime/binding-mqtt-kafka/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionProxyIT.java +++ b/runtime/binding-mqtt-kafka/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionProxyIT.java @@ -33,9 +33,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-mqtt-kafka/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSubscribeProxyIT.java b/runtime/binding-mqtt-kafka/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSubscribeProxyIT.java index e109973413..3df88ab1d3 100644 --- a/runtime/binding-mqtt-kafka/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSubscribeProxyIT.java +++ b/runtime/binding-mqtt-kafka/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSubscribeProxyIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; @@ -526,6 +526,17 @@ public void shouldReceiveMessageQoS2() throws Exception k3po.finish(); } + @Test + @Configuration("proxy.yaml") + @Configure(name = WILL_AVAILABLE_NAME, value = "false") + @Specification({ + "${mqtt}/subscribe.qos2.version1.offset.metadata/client", + "${kafka}/subscribe.qos2.version1.offset.metadata/server"}) + public void shouldReceiveMessageQoS2WithVersion1OffsetMetadata() throws Exception + { + k3po.finish(); + } + @Test @Configuration("proxy.yaml") @Configure(name = WILL_AVAILABLE_NAME, value = "false") diff --git a/runtime/binding-mqtt/pom.xml b/runtime/binding-mqtt/pom.xml index 1976bee0b8..fd6a90cc68 100644 --- a/runtime/binding-mqtt/pom.xml +++ b/runtime/binding-mqtt/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.88 3 @@ -66,13 +64,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -167,7 +165,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/config/MqttOptionsConfig.java b/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/config/MqttOptionsConfig.java index 1b1e9479f8..c73de19f61 100644 --- a/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/config/MqttOptionsConfig.java +++ b/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/config/MqttOptionsConfig.java @@ -26,6 +26,7 @@ import java.util.stream.Stream; import io.aklivity.zilla.runtime.binding.mqtt.internal.config.MqttVersion; +import io.aklivity.zilla.runtime.engine.config.ModelConfig; import io.aklivity.zilla.runtime.engine.config.OptionsConfig; public class MqttOptionsConfig extends OptionsConfig @@ -50,18 +51,24 @@ public MqttOptionsConfig( List topics, List versions) { - super(topics != null && !topics.isEmpty() + super(resolveModels(topics), List.of()); + this.authorization = authorization; + this.topics = topics; + this.versions = versions; + } + + private static List resolveModels( + List topics) + { + return topics != null && !topics.isEmpty() ? topics.stream() .flatMap(topic -> Stream.concat( - Stream.of(topic.content), + Stream.of(topic.content), Optional.ofNullable(topic.userProperties).orElseGet(Collections::emptyList).stream() - .flatMap(p -> Stream.of(p.value)) - .filter(Objects::nonNull)) + .flatMap(p -> Stream.of(p.value)) + .filter(Objects::nonNull)) .filter(Objects::nonNull)) .collect(Collectors.toList()) - : emptyList()); - this.authorization = authorization; - this.topics = topics; - this.versions = versions; + : emptyList(); } } diff --git a/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java b/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java index ba102af34c..a1447176d7 100644 --- a/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java +++ b/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java @@ -26,8 +26,6 @@ public final class MqttEventFormatter implements EventFormatterSpi { - private static final String CLIENT_CONNECTED_FORMAT = "CLIENT_CONNECTED %s %s"; - private final EventFW eventRO = new EventFW(); private final MqttEventExFW mqttEventExRO = new MqttEventExFW(); @@ -50,7 +48,10 @@ public String format( case CLIENT_CONNECTED: { MqttClientConnectedExFW ex = extension.clientConnected(); - result = String.format(CLIENT_CONNECTED_FORMAT, identity(ex.identity()), asString(ex.clientId())); + result = String.format("Session authorization (%s) was successful for client id (%s).", + identity(ex.identity()), + asString(ex.clientId()) + ); break; } } diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/ConnectionIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/ConnectionIT.java index cf0fec79b1..d28bd26048 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/ConnectionIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/ConnectionIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/PingIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/PingIT.java index 3a54285ee8..bb76a49fe3 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/PingIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/PingIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/PublishIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/PublishIT.java index a438256ece..75aa88715a 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/PublishIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/PublishIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/SubscribeIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/SubscribeIT.java index fa5fc80abf..acd136ad43 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/SubscribeIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/SubscribeIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/UnsubscribeIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/UnsubscribeIT.java index a8d27178a4..f31507ad7c 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/UnsubscribeIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/client/v5/UnsubscribeIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/ConnectionIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/ConnectionIT.java index 3fc6db15b0..192499f957 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/ConnectionIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/ConnectionIT.java @@ -29,9 +29,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/PingIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/PingIT.java index c71cd6e85b..6c36fafd9e 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/PingIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/PingIT.java @@ -27,9 +27,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/PublishIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/PublishIT.java index 940f69f324..9f35aa5fc4 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/PublishIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/PublishIT.java @@ -28,9 +28,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/SessionIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/SessionIT.java index a8360ce722..433121477c 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/SessionIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/SessionIT.java @@ -28,9 +28,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/SubscribeIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/SubscribeIT.java index d3e3797ef0..79b8ed9d1c 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/SubscribeIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/SubscribeIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/UnsubscribeIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/UnsubscribeIT.java index db6022c2e9..6e198f309b 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/UnsubscribeIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v4/UnsubscribeIT.java @@ -27,9 +27,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/ConnectionIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/ConnectionIT.java index 7d22e40ed3..84593c9e71 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/ConnectionIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/ConnectionIT.java @@ -29,9 +29,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/PingIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/PingIT.java index a3d88e1eef..05e282ac65 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/PingIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/PingIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/PublishIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/PublishIT.java index 2b67a301b2..1ae148e488 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/PublishIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/PublishIT.java @@ -29,9 +29,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/SessionIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/SessionIT.java index 19fdde8dd6..c4da6e93c2 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/SessionIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/SessionIT.java @@ -27,9 +27,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/SubscribeIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/SubscribeIT.java index e5a8bfab7d..4ded94d3ad 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/SubscribeIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/SubscribeIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/UnsubscribeIT.java b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/UnsubscribeIT.java index 6155ed0645..d4d1da2f0f 100644 --- a/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/UnsubscribeIT.java +++ b/runtime/binding-mqtt/src/test/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/server/v5/UnsubscribeIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-openapi-asyncapi/pom.xml b/runtime/binding-openapi-asyncapi/pom.xml index b46f0d0766..da0160ff00 100644 --- a/runtime/binding-openapi-asyncapi/pom.xml +++ b/runtime/binding-openapi-asyncapi/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.60 4 @@ -111,13 +109,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -226,7 +224,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-openapi-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/openapi/asyncapi/internal/config/OpenapiAsyncapiBindingConfig.java b/runtime/binding-openapi-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/openapi/asyncapi/internal/config/OpenapiAsyncapiBindingConfig.java index d7ae8c04bd..c6cb86540b 100644 --- a/runtime/binding-openapi-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/openapi/asyncapi/internal/config/OpenapiAsyncapiBindingConfig.java +++ b/runtime/binding-openapi-asyncapi/src/main/java/io/aklivity/zilla/runtime/binding/openapi/asyncapi/internal/config/OpenapiAsyncapiBindingConfig.java @@ -144,7 +144,6 @@ public void attach( Object2ObjectHashMap::new)); this.composite = namespaceGenerator.generate(binding, openapis, asyncapis, openapiSchemaIdsByApiId::get); - this.composite.readURL = binding.readURL; attach.accept(this.composite); BindingConfig mappingBinding = composite.bindings.stream() diff --git a/runtime/binding-openapi-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/openapi/asyncapi/internal/streams/OpenapiAsyncapiIT.java b/runtime/binding-openapi-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/openapi/asyncapi/internal/streams/OpenapiAsyncapiIT.java index 70d72e6ca3..a001cb0135 100644 --- a/runtime/binding-openapi-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/openapi/asyncapi/internal/streams/OpenapiAsyncapiIT.java +++ b/runtime/binding-openapi-asyncapi/src/test/java/io/aklivity/zilla/runtime/binding/openapi/asyncapi/internal/streams/OpenapiAsyncapiIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-openapi/pom.xml b/runtime/binding-openapi/pom.xml index c61f4f8175..25fee1f5ea 100644 --- a/runtime/binding-openapi/pom.xml +++ b/runtime/binding-openapi/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.60 4 @@ -106,13 +104,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -227,7 +225,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-openapi/src/main/java/io/aklivity/zilla/runtime/binding/openapi/internal/config/OpenapiBindingConfig.java b/runtime/binding-openapi/src/main/java/io/aklivity/zilla/runtime/binding/openapi/internal/config/OpenapiBindingConfig.java index 27f91d386f..a3a3d8e4aa 100644 --- a/runtime/binding-openapi/src/main/java/io/aklivity/zilla/runtime/binding/openapi/internal/config/OpenapiBindingConfig.java +++ b/runtime/binding-openapi/src/main/java/io/aklivity/zilla/runtime/binding/openapi/internal/config/OpenapiBindingConfig.java @@ -138,7 +138,6 @@ public void attach( for (OpenapiNamespaceConfig namespaceConfig : namespaceConfigs.values()) { final NamespaceConfig composite = namespaceGenerator.generate(binding, namespaceConfig); - composite.readURL = binding.readURL; attach.accept(composite); namespaceConfig.configs.forEach(c -> { diff --git a/runtime/binding-openapi/src/test/java/io/aklivity/zilla/runtime/binding/openapi/internal/streams/OpenapiClientIT.java b/runtime/binding-openapi/src/test/java/io/aklivity/zilla/runtime/binding/openapi/internal/streams/OpenapiClientIT.java index 3a2ffd74da..d32f97cf3d 100644 --- a/runtime/binding-openapi/src/test/java/io/aklivity/zilla/runtime/binding/openapi/internal/streams/OpenapiClientIT.java +++ b/runtime/binding-openapi/src/test/java/io/aklivity/zilla/runtime/binding/openapi/internal/streams/OpenapiClientIT.java @@ -23,10 +23,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-openapi/src/test/java/io/aklivity/zilla/runtime/binding/openapi/internal/streams/OpenapiServerIT.java b/runtime/binding-openapi/src/test/java/io/aklivity/zilla/runtime/binding/openapi/internal/streams/OpenapiServerIT.java index 4b22c9fdac..e7c6a2aabc 100644 --- a/runtime/binding-openapi/src/test/java/io/aklivity/zilla/runtime/binding/openapi/internal/streams/OpenapiServerIT.java +++ b/runtime/binding-openapi/src/test/java/io/aklivity/zilla/runtime/binding/openapi/internal/streams/OpenapiServerIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-proxy/pom.xml b/runtime/binding-proxy/pom.xml index 36047c7385..80abebb78a 100644 --- a/runtime/binding-proxy/pom.xml +++ b/runtime/binding-proxy/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.93 0 @@ -66,13 +64,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -172,7 +170,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-proxy/src/main/java/io/aklivity/zilla/runtime/binding/proxy/internal/config/ProxyOptionsConfigAdapter.java b/runtime/binding-proxy/src/main/java/io/aklivity/zilla/runtime/binding/proxy/internal/config/ProxyOptionsConfigAdapter.java index 4268f92a72..df60b3ce64 100644 --- a/runtime/binding-proxy/src/main/java/io/aklivity/zilla/runtime/binding/proxy/internal/config/ProxyOptionsConfigAdapter.java +++ b/runtime/binding-proxy/src/main/java/io/aklivity/zilla/runtime/binding/proxy/internal/config/ProxyOptionsConfigAdapter.java @@ -24,7 +24,6 @@ import io.aklivity.zilla.runtime.binding.proxy.internal.ProxyBinding; import io.aklivity.zilla.runtime.engine.config.OptionsConfig; import io.aklivity.zilla.runtime.engine.config.OptionsConfigAdapterSpi; -import io.aklivity.zilla.runtime.engine.config.OptionsConfigAdapterSpi.Kind; public final class ProxyOptionsConfigAdapter implements OptionsConfigAdapterSpi, JsonbAdapter { diff --git a/runtime/binding-proxy/src/test/java/io/aklivity/zilla/runtime/binding/proxy/internal/streams/ProxyClientIT.java b/runtime/binding-proxy/src/test/java/io/aklivity/zilla/runtime/binding/proxy/internal/streams/ProxyClientIT.java index 2212900dea..cfb1174830 100644 --- a/runtime/binding-proxy/src/test/java/io/aklivity/zilla/runtime/binding/proxy/internal/streams/ProxyClientIT.java +++ b/runtime/binding-proxy/src/test/java/io/aklivity/zilla/runtime/binding/proxy/internal/streams/ProxyClientIT.java @@ -28,9 +28,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-proxy/src/test/java/io/aklivity/zilla/runtime/binding/proxy/internal/streams/ProxyServerIT.java b/runtime/binding-proxy/src/test/java/io/aklivity/zilla/runtime/binding/proxy/internal/streams/ProxyServerIT.java index 117a75ef65..e18f7f9916 100644 --- a/runtime/binding-proxy/src/test/java/io/aklivity/zilla/runtime/binding/proxy/internal/streams/ProxyServerIT.java +++ b/runtime/binding-proxy/src/test/java/io/aklivity/zilla/runtime/binding/proxy/internal/streams/ProxyServerIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse-kafka/pom.xml b/runtime/binding-sse-kafka/pom.xml index 1445f74d7b..82db90fe1a 100644 --- a/runtime/binding-sse-kafka/pom.xml +++ b/runtime/binding-sse-kafka/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.90 0 @@ -76,13 +74,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -177,7 +175,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/config/SseKafkaConditionConfig.java b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/config/SseKafkaConditionConfig.java index 8681ab6ab0..3bf80807a4 100644 --- a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/config/SseKafkaConditionConfig.java +++ b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/config/SseKafkaConditionConfig.java @@ -14,15 +14,28 @@ */ package io.aklivity.zilla.runtime.binding.sse.kafka.config; +import java.util.function.Function; + import io.aklivity.zilla.runtime.engine.config.ConditionConfig; public final class SseKafkaConditionConfig extends ConditionConfig { public final String path; - public SseKafkaConditionConfig( + SseKafkaConditionConfig( String path) { this.path = path; } + + public static SseKafkaConditionConfigBuilder builder() + { + return new SseKafkaConditionConfigBuilder<>(SseKafkaConditionConfig.class::cast); + } + + public static SseKafkaConditionConfigBuilder builder( + Function mapper) + { + return new SseKafkaConditionConfigBuilder<>(mapper); + } } diff --git a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/config/SseKafkaConditionConfigBuilder.java b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/config/SseKafkaConditionConfigBuilder.java new file mode 100644 index 0000000000..21610d00a1 --- /dev/null +++ b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/config/SseKafkaConditionConfigBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.binding.sse.kafka.config; + +import java.util.function.Function; + +import io.aklivity.zilla.runtime.engine.config.ConditionConfig; +import io.aklivity.zilla.runtime.engine.config.ConfigBuilder; + +public final class SseKafkaConditionConfigBuilder extends ConfigBuilder> +{ + private final Function mapper; + private String path; + + SseKafkaConditionConfigBuilder( + Function mapper) + { + this.mapper = mapper; + } + + public SseKafkaConditionConfigBuilder path( + String path) + { + this.path = path; + return this; + } + + + @Override + @SuppressWarnings("unchecked") + protected Class> thisType() + { + return (Class>) getClass(); + } + + + @Override + public T build() + { + return mapper.apply(new SseKafkaConditionConfig(path)); + } +} diff --git a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithConfig.java b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/config/SseKafkaWithConfig.java similarity index 71% rename from runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithConfig.java rename to runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/config/SseKafkaWithConfig.java index 053fe58769..45b50a9118 100644 --- a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithConfig.java +++ b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/config/SseKafkaWithConfig.java @@ -12,12 +12,14 @@ * WARRANTIES OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package io.aklivity.zilla.runtime.binding.sse.kafka.internal.config; +package io.aklivity.zilla.runtime.binding.sse.kafka.config; import java.util.List; import java.util.Objects; import java.util.Optional; +import java.util.function.Function; +import io.aklivity.zilla.runtime.binding.sse.kafka.internal.config.SseKafkaWithFilterConfig; import io.aklivity.zilla.runtime.engine.config.WithConfig; public final class SseKafkaWithConfig extends WithConfig @@ -30,7 +32,7 @@ public final class SseKafkaWithConfig extends WithConfig public final Optional> filters; public final String eventId; - public SseKafkaWithConfig( + SseKafkaWithConfig( String topic, List filters, String eventId) @@ -39,4 +41,15 @@ public SseKafkaWithConfig( this.filters = Optional.ofNullable(filters); this.eventId = Objects.requireNonNull(eventId); } + + public static SseKafkaWithConfigBuilder builder() + { + return new SseKafkaWithConfigBuilder<>(SseKafkaWithConfig.class::cast); + } + + public static SseKafkaWithConfigBuilder builder( + Function mapper) + { + return new SseKafkaWithConfigBuilder<>(mapper); + } } diff --git a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/config/SseKafkaWithConfigBuilder.java b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/config/SseKafkaWithConfigBuilder.java new file mode 100644 index 0000000000..8569572e1f --- /dev/null +++ b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/config/SseKafkaWithConfigBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.binding.sse.kafka.config; + +import java.util.List; +import java.util.function.Function; + +import io.aklivity.zilla.runtime.binding.sse.kafka.internal.config.SseKafkaWithFilterConfig; +import io.aklivity.zilla.runtime.engine.config.ConfigBuilder; +import io.aklivity.zilla.runtime.engine.config.WithConfig; + +public final class SseKafkaWithConfigBuilder extends ConfigBuilder> +{ + private final Function mapper; + + public String topic; + public List filters; + public String eventId; + + SseKafkaWithConfigBuilder( + Function mapper) + { + this.mapper = mapper; + } + + public SseKafkaWithConfigBuilder topic( + String topic) + { + this.topic = topic; + return this; + } + + public SseKafkaWithConfigBuilder filters( + List filters) + { + this.filters = filters; + return this; + } + + public SseKafkaWithConfigBuilder eventId( + String eventId) + { + this.eventId = eventId; + return this; + } + + @Override + @SuppressWarnings("unchecked") + protected Class> thisType() + { + return (Class>) getClass(); + } + + + @Override + public T build() + { + return mapper.apply(new SseKafkaWithConfig(topic, filters, eventId)); + } +} diff --git a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaConditionConfigAdapter.java b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaConditionConfigAdapter.java index c1430063f8..5a6f5f6fee 100644 --- a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaConditionConfigAdapter.java +++ b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaConditionConfigAdapter.java @@ -58,6 +58,6 @@ public ConditionConfig adaptFromJson( ? object.getString(PATH_NAME) : null; - return new SseKafkaConditionConfig(path); + return SseKafkaConditionConfig.builder().path(path).build(); } } diff --git a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaRouteConfig.java b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaRouteConfig.java index abbee580bb..715dfbf4df 100644 --- a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaRouteConfig.java +++ b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaRouteConfig.java @@ -26,6 +26,7 @@ import java.util.stream.Collectors; import io.aklivity.zilla.runtime.binding.sse.kafka.config.SseKafkaConditionConfig; +import io.aklivity.zilla.runtime.binding.sse.kafka.config.SseKafkaWithConfig; import io.aklivity.zilla.runtime.engine.config.RouteConfig; import io.aklivity.zilla.runtime.engine.util.function.LongObjectBiFunction; diff --git a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithConfigAdapter.java b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithConfigAdapter.java index d713e6df37..e9d23fb7f1 100644 --- a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithConfigAdapter.java +++ b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithConfigAdapter.java @@ -14,7 +14,7 @@ */ package io.aklivity.zilla.runtime.binding.sse.kafka.internal.config; -import static io.aklivity.zilla.runtime.binding.sse.kafka.internal.config.SseKafkaWithConfig.EVENT_ID_DEFAULT; +import static io.aklivity.zilla.runtime.binding.sse.kafka.config.SseKafkaWithConfig.EVENT_ID_DEFAULT; import java.util.ArrayList; import java.util.List; @@ -26,6 +26,7 @@ import jakarta.json.JsonObjectBuilder; import jakarta.json.bind.adapter.JsonbAdapter; +import io.aklivity.zilla.runtime.binding.sse.kafka.config.SseKafkaWithConfig; import io.aklivity.zilla.runtime.binding.sse.kafka.internal.SseKafkaBinding; import io.aklivity.zilla.runtime.engine.config.WithConfig; import io.aklivity.zilla.runtime.engine.config.WithConfigAdapterSpi; @@ -156,6 +157,10 @@ public WithConfig adaptFromJson( } } - return new SseKafkaWithConfig(newTopic, newFilters, newEventId); + return SseKafkaWithConfig.builder() + .topic(newTopic) + .filters(newFilters) + .eventId(newEventId) + .build(); } } diff --git a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithResolver.java b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithResolver.java index 5e0151cad6..242c4e4144 100644 --- a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithResolver.java +++ b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithResolver.java @@ -23,6 +23,7 @@ import org.agrona.DirectBuffer; +import io.aklivity.zilla.runtime.binding.sse.kafka.config.SseKafkaWithConfig; import io.aklivity.zilla.runtime.binding.sse.kafka.internal.stream.SseKafkaIdHelper; import io.aklivity.zilla.runtime.binding.sse.kafka.internal.types.Array32FW; import io.aklivity.zilla.runtime.binding.sse.kafka.internal.types.KafkaOffsetFW; diff --git a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/stream/SseKafkaProxyFactory.java b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/stream/SseKafkaProxyFactory.java index 53b9bdee5c..83ffa98f85 100644 --- a/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/stream/SseKafkaProxyFactory.java +++ b/runtime/binding-sse-kafka/src/main/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/stream/SseKafkaProxyFactory.java @@ -14,8 +14,8 @@ */ package io.aklivity.zilla.runtime.binding.sse.kafka.internal.stream; -import static io.aklivity.zilla.runtime.binding.sse.kafka.internal.config.SseKafkaWithConfig.EVENT_ID_ETAG_ONLY; -import static io.aklivity.zilla.runtime.binding.sse.kafka.internal.config.SseKafkaWithConfig.EVENT_ID_KEY64_AND_ETAG; +import static io.aklivity.zilla.runtime.binding.sse.kafka.config.SseKafkaWithConfig.EVENT_ID_ETAG_ONLY; +import static io.aklivity.zilla.runtime.binding.sse.kafka.config.SseKafkaWithConfig.EVENT_ID_KEY64_AND_ETAG; import java.util.function.LongUnaryOperator; diff --git a/runtime/binding-sse-kafka/src/test/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaConditionConfigAdapterTest.java b/runtime/binding-sse-kafka/src/test/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaConditionConfigAdapterTest.java index 98e7308c57..1d0f60b1b3 100644 --- a/runtime/binding-sse-kafka/src/test/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaConditionConfigAdapterTest.java +++ b/runtime/binding-sse-kafka/src/test/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaConditionConfigAdapterTest.java @@ -57,7 +57,7 @@ public void shouldReadCondition() @Test public void shouldWriteCondition() { - SseKafkaConditionConfig condition = new SseKafkaConditionConfig("/test"); + SseKafkaConditionConfig condition = SseKafkaConditionConfig.builder().path("/test").build(); String text = jsonb.toJson(condition); diff --git a/runtime/binding-sse-kafka/src/test/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithConfigAdapterTest.java b/runtime/binding-sse-kafka/src/test/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithConfigAdapterTest.java index 390fae4a87..b8d0408c67 100644 --- a/runtime/binding-sse-kafka/src/test/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithConfigAdapterTest.java +++ b/runtime/binding-sse-kafka/src/test/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/config/SseKafkaWithConfigAdapterTest.java @@ -17,8 +17,8 @@ import static com.github.npathai.hamcrestopt.OptionalMatchers.isEmpty; import static com.github.npathai.hamcrestopt.OptionalMatchers.isPresentAnd; import static com.vtence.hamcrest.jpa.HasFieldWithValue.hasField; -import static io.aklivity.zilla.runtime.binding.sse.kafka.internal.config.SseKafkaWithConfig.EVENT_ID_DEFAULT; -import static io.aklivity.zilla.runtime.binding.sse.kafka.internal.config.SseKafkaWithConfig.EVENT_ID_KEY64_AND_ETAG; +import static io.aklivity.zilla.runtime.binding.sse.kafka.config.SseKafkaWithConfig.EVENT_ID_DEFAULT; +import static io.aklivity.zilla.runtime.binding.sse.kafka.config.SseKafkaWithConfig.EVENT_ID_KEY64_AND_ETAG; import static java.util.Collections.singletonList; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.both; @@ -35,6 +35,8 @@ import org.junit.Before; import org.junit.Test; +import io.aklivity.zilla.runtime.binding.sse.kafka.config.SseKafkaWithConfig; + public class SseKafkaWithConfigAdapterTest { private Jsonb jsonb; @@ -66,7 +68,7 @@ public void shouldReadWithTopic() @Test public void shouldWriteWithTopic() { - SseKafkaWithConfig with = new SseKafkaWithConfig("test", null, EVENT_ID_DEFAULT); + SseKafkaWithConfig with = SseKafkaWithConfig.builder().topic("test").eventId(EVENT_ID_DEFAULT).build(); String text = jsonb.toJson(with); @@ -107,14 +109,16 @@ public void shouldReadWithTopicAndFilters() @Test public void shouldWriteWithTopicAndFilters() { - SseKafkaWithConfig with = new SseKafkaWithConfig( - "test", - singletonList(new SseKafkaWithFilterConfig( - "fixed-key", - singletonList(new SseKafkaWithFilterHeaderConfig( - "tag", - "fixed-tag")))), - EVENT_ID_DEFAULT); + SseKafkaWithConfig with = SseKafkaWithConfig.builder() + .topic("test") + .filters( + singletonList(new SseKafkaWithFilterConfig( + "fixed-key", + singletonList(new SseKafkaWithFilterHeaderConfig( + "tag", + "fixed-tag"))))) + .eventId(EVENT_ID_DEFAULT) + .build(); String text = jsonb.toJson(with); @@ -147,10 +151,10 @@ public void shouldReadWithTopicAndEventId() @Test public void shouldWriteWithTopicAndEventId() { - SseKafkaWithConfig with = new SseKafkaWithConfig( - "test", - null, - "[\"${base64(key)}\",\"${etag}\"]"); + SseKafkaWithConfig with = SseKafkaWithConfig.builder() + .topic("test") + .eventId("[\"${base64(key)}\",\"${etag}\"]") + .build(); String text = jsonb.toJson(with); diff --git a/runtime/binding-sse-kafka/src/test/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/stream/SseKafkaProxyIT.java b/runtime/binding-sse-kafka/src/test/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/stream/SseKafkaProxyIT.java index 6990dc85d2..4f3d32a9ba 100644 --- a/runtime/binding-sse-kafka/src/test/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/stream/SseKafkaProxyIT.java +++ b/runtime/binding-sse-kafka/src/test/java/io/aklivity/zilla/runtime/binding/sse/kafka/internal/stream/SseKafkaProxyIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/pom.xml b/runtime/binding-sse/pom.xml index 97b8f3742c..de4f5c6999 100644 --- a/runtime/binding-sse/pom.xml +++ b/runtime/binding-sse/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.80 1 @@ -66,13 +64,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -167,7 +165,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseConditionConfig.java b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseConditionConfig.java index 0d6a8750d1..50f2731b6c 100644 --- a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseConditionConfig.java +++ b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseConditionConfig.java @@ -15,13 +15,26 @@ */ package io.aklivity.zilla.runtime.binding.sse.config; +import java.util.function.Function; + import io.aklivity.zilla.runtime.engine.config.ConditionConfig; public final class SseConditionConfig extends ConditionConfig { public final String path; - public SseConditionConfig( + public static SseConditionConfigBuilder builder() + { + return new SseConditionConfigBuilder<>(SseConditionConfig.class::cast); + } + + public static SseConditionConfigBuilder builder( + Function mapper) + { + return new SseConditionConfigBuilder<>(mapper); + } + + SseConditionConfig( String path) { this.path = path; diff --git a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseConditionConfigBuilder.java b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseConditionConfigBuilder.java new file mode 100644 index 0000000000..b5529e6ada --- /dev/null +++ b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseConditionConfigBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2021-2023 Aklivity Inc. + * + * Aklivity licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.aklivity.zilla.runtime.binding.sse.config; + +import java.util.function.Function; + +import io.aklivity.zilla.runtime.engine.config.ConditionConfig; +import io.aklivity.zilla.runtime.engine.config.ConfigBuilder; + +public class SseConditionConfigBuilder extends ConfigBuilder> +{ + private final Function mapper; + + public String path; + + SseConditionConfigBuilder( + Function mapper) + { + this.mapper = mapper; + } + + @Override + @SuppressWarnings("unchecked") + protected Class> thisType() + { + return (Class>) getClass(); + } + + + public SseConditionConfigBuilder path( + String path) + { + this.path = path; + return this; + } + + public T build() + { + return mapper.apply(new SseConditionConfig(path)); + } +} diff --git a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseOptionsConfig.java b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseOptionsConfig.java index d8bd6baff8..be1bad73fb 100644 --- a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseOptionsConfig.java +++ b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseOptionsConfig.java @@ -15,15 +15,52 @@ */ package io.aklivity.zilla.runtime.binding.sse.config; +import static java.util.Collections.emptyList; + +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import io.aklivity.zilla.runtime.engine.config.ModelConfig; import io.aklivity.zilla.runtime.engine.config.OptionsConfig; public final class SseOptionsConfig extends OptionsConfig { public final int retry; + public final List requests; + + + public static SseOptionsConfigBuilder builder() + { + return new SseOptionsConfigBuilder<>(SseOptionsConfig.class::cast); + } - public SseOptionsConfig( - int retry) + public static SseOptionsConfigBuilder builder( + Function mapper) { + return new SseOptionsConfigBuilder<>(mapper); + } + + SseOptionsConfig( + int retry, + List requests) + { + super(resolveModels(requests), List.of()); this.retry = retry; + this.requests = requests; + } + + private static List resolveModels( + List requests) + { + return requests != null && !requests.isEmpty() + ? requests.stream() + .flatMap(path -> + Stream.of(path.content) + .filter(Objects::nonNull)) + .collect(Collectors.toList()) + : emptyList(); } } diff --git a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseOptionsConfigBuilder.java b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseOptionsConfigBuilder.java new file mode 100644 index 0000000000..e3803aff0a --- /dev/null +++ b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseOptionsConfigBuilder.java @@ -0,0 +1,86 @@ +/* + * Copyright 2021-2023 Aklivity Inc. + * + * Aklivity licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.aklivity.zilla.runtime.binding.sse.config; + +import java.util.LinkedList; +import java.util.List; +import java.util.function.Function; + +import io.aklivity.zilla.runtime.engine.config.ConfigBuilder; +import io.aklivity.zilla.runtime.engine.config.OptionsConfig; + +public class SseOptionsConfigBuilder extends ConfigBuilder> +{ + private final Function mapper; + + private int retry; + private List requests; + + SseOptionsConfigBuilder( + Function mapper) + { + this.mapper = mapper; + } + + @Override + @SuppressWarnings("unchecked") + protected Class> thisType() + { + return (Class>) getClass(); + } + + public SseOptionsConfigBuilder retry( + int retry) + { + + this.retry = retry; + return this; + } + + public SseOptionsConfigBuilder requests( + List requests) + { + if (requests == null) + { + requests = new LinkedList<>(); + } + this.requests = requests; + return this; + } + + public SseOptionsConfigBuilder request( + SseRequestConfig request) + { + if (this.requests == null) + { + this.requests = new LinkedList<>(); + } + this.requests.add(request); + return this; + } + + public SsePathConfigBuilder> request() + { + return new SsePathConfigBuilder<>(this::request); + } + + @Override + public T build() + { + return mapper.apply(new SseOptionsConfig(retry, requests)); + } + +} diff --git a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SsePathConfigBuilder.java b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SsePathConfigBuilder.java new file mode 100644 index 0000000000..47e09e9ca7 --- /dev/null +++ b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SsePathConfigBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2021-2023 Aklivity Inc. + * + * Aklivity licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.aklivity.zilla.runtime.binding.sse.config; + +import java.util.function.Function; + +import io.aklivity.zilla.runtime.engine.config.ConfigBuilder; +import io.aklivity.zilla.runtime.engine.config.ModelConfig; + +public class SsePathConfigBuilder extends ConfigBuilder> +{ + private final Function mapper; + + private String path; + private ModelConfig content; + + SsePathConfigBuilder( + Function mapper) + { + this.mapper = mapper; + } + + @Override + @SuppressWarnings("unchecked") + protected Class> thisType() + { + return (Class>) getClass(); + } + + public SsePathConfigBuilder path( + String path) + { + this.path = path; + return this; + } + + public SsePathConfigBuilder content( + ModelConfig content) + { + this.content = content; + return this; + } + + public , C>> C content( + Function>, C> content) + { + return content.apply(this::content); + } + + @Override + public T build() + { + return mapper.apply(new SseRequestConfig(path, content)); + } +} diff --git a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseRequestConfig.java b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseRequestConfig.java new file mode 100644 index 0000000000..96723a993f --- /dev/null +++ b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/config/SseRequestConfig.java @@ -0,0 +1,39 @@ +/* + * Copyright 2021-2023 Aklivity Inc. + * + * Aklivity licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.aklivity.zilla.runtime.binding.sse.config; + +import static java.util.function.Function.identity; + +import io.aklivity.zilla.runtime.engine.config.ModelConfig; + +public class SseRequestConfig +{ + public final String path; + public final ModelConfig content; + + SseRequestConfig( + String path, + ModelConfig content) + { + this.path = path; + this.content = content; + } + + public static SsePathConfigBuilder builder() + { + return new SsePathConfigBuilder<>(identity()); + } +} diff --git a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseBindingConfig.java b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseBindingConfig.java index 048347fd43..f037159505 100644 --- a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseBindingConfig.java +++ b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseBindingConfig.java @@ -18,21 +18,27 @@ import static io.aklivity.zilla.runtime.binding.sse.internal.config.SseOptionsConfigAdapter.RETRY_DEFAULT; import static java.util.stream.Collectors.toList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import io.aklivity.zilla.runtime.binding.sse.config.SseOptionsConfig; import io.aklivity.zilla.runtime.engine.config.BindingConfig; import io.aklivity.zilla.runtime.engine.config.KindConfig; +import io.aklivity.zilla.runtime.engine.config.ModelConfig; public final class SseBindingConfig { - private static final SseOptionsConfig DEFAULT_OPTIONS = new SseOptionsConfig(RETRY_DEFAULT); + private static final SseOptionsConfig DEFAULT_OPTIONS = SseOptionsConfig.builder().retry(RETRY_DEFAULT).build(); public final long id; public final String name; public final SseOptionsConfig options; public final KindConfig kind; public final List routes; + public final Map requests; public SseBindingConfig( BindingConfig binding) @@ -42,6 +48,12 @@ public SseBindingConfig( this.kind = binding.kind; this.options = binding.options instanceof SseOptionsConfig ? (SseOptionsConfig) binding.options : DEFAULT_OPTIONS; this.routes = binding.routes.stream().map(SseRouteConfig::new).collect(toList()); + this.requests = new HashMap<>(); + if (options.requests != null) + { + options.requests.forEach(p -> + requests.put(Pattern.compile(p.path).matcher(""), p.content)); + } } public SseRouteConfig resolve( @@ -53,4 +65,24 @@ public SseRouteConfig resolve( .findFirst() .orElse(null); } + + public ModelConfig supplyModelConfig( + String path) + { + ModelConfig config = null; + if (requests != null) + { + for (Map.Entry e : requests.entrySet()) + { + final Matcher matcher = e.getKey(); + matcher.reset(path); + if (matcher.find()) + { + config = e.getValue(); + break; + } + } + } + return config; + } } diff --git a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseConditionConfigAdapter.java b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseConditionConfigAdapter.java index e57ddd58d5..39dbb9b917 100644 --- a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseConditionConfigAdapter.java +++ b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseConditionConfigAdapter.java @@ -59,6 +59,6 @@ public ConditionConfig adaptFromJson( ? object.getString(PATH_NAME) : null; - return new SseConditionConfig(path); + return SseConditionConfig.builder().path(path).build(); } } diff --git a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseOptionsConfigAdapter.java b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseOptionsConfigAdapter.java index 733bb75f7c..4e0ee37962 100644 --- a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseOptionsConfigAdapter.java +++ b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseOptionsConfigAdapter.java @@ -15,12 +15,18 @@ */ package io.aklivity.zilla.runtime.binding.sse.internal.config; +import java.util.List; +import java.util.stream.Collectors; + import jakarta.json.Json; +import jakarta.json.JsonArrayBuilder; import jakarta.json.JsonObject; import jakarta.json.JsonObjectBuilder; import jakarta.json.bind.adapter.JsonbAdapter; import io.aklivity.zilla.runtime.binding.sse.config.SseOptionsConfig; +import io.aklivity.zilla.runtime.binding.sse.config.SseOptionsConfigBuilder; +import io.aklivity.zilla.runtime.binding.sse.config.SseRequestConfig; import io.aklivity.zilla.runtime.binding.sse.internal.SseBinding; import io.aklivity.zilla.runtime.engine.config.OptionsConfig; import io.aklivity.zilla.runtime.engine.config.OptionsConfigAdapterSpi; @@ -28,8 +34,12 @@ public final class SseOptionsConfigAdapter implements OptionsConfigAdapterSpi, JsonbAdapter { private static final String RETRY_NAME = "retry"; + private static final String REQUESTS_NAME = "requests"; public static final int RETRY_DEFAULT = 2000; + + private final SseRequestConfigAdapter ssePath = new SseRequestConfigAdapter(); + @Override public Kind kind() { @@ -55,6 +65,15 @@ public JsonObject adaptToJson( object.add(RETRY_NAME, sseOptions.retry); } + if (sseOptions.requests != null) + { + JsonArrayBuilder requests = Json.createArrayBuilder(); + sseOptions.requests.stream() + .map(ssePath::adaptToJson) + .forEach(requests::add); + object.add(REQUESTS_NAME, requests); + } + return object.build(); } @@ -62,10 +81,25 @@ public JsonObject adaptToJson( public OptionsConfig adaptFromJson( JsonObject object) { - int retry = object.containsKey(RETRY_NAME) - ? object.getInt(RETRY_NAME) - : SseOptionsConfigAdapter.RETRY_DEFAULT; + SseOptionsConfigBuilder sseOptions = SseOptionsConfig.builder(); + + if (object.containsKey(RETRY_NAME)) + { + sseOptions.retry(object.getInt(RETRY_NAME)); + } + else + { + sseOptions.retry(SseOptionsConfigAdapter.RETRY_DEFAULT); + } + + if (object.containsKey(REQUESTS_NAME)) + { + List requests = object.getJsonArray(REQUESTS_NAME).stream() + .map(item -> ssePath.adaptFromJson((JsonObject) item)) + .collect(Collectors.toList()); + sseOptions.requests(requests); + } - return new SseOptionsConfig(retry); + return sseOptions.build(); } } diff --git a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseRequestConfigAdapter.java b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseRequestConfigAdapter.java new file mode 100644 index 0000000000..346aa6b2d4 --- /dev/null +++ b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseRequestConfigAdapter.java @@ -0,0 +1,68 @@ +/* + * Copyright 2021-2023 Aklivity Inc. + * + * Aklivity licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.aklivity.zilla.runtime.binding.sse.internal.config; + +import jakarta.json.Json; +import jakarta.json.JsonObject; +import jakarta.json.JsonObjectBuilder; +import jakarta.json.JsonValue; +import jakarta.json.bind.adapter.JsonbAdapter; + +import io.aklivity.zilla.runtime.binding.sse.config.SsePathConfigBuilder; +import io.aklivity.zilla.runtime.binding.sse.config.SseRequestConfig; +import io.aklivity.zilla.runtime.engine.config.ModelConfigAdapter; + +public class SseRequestConfigAdapter implements JsonbAdapter +{ + private static final String PATH_NAME = "path"; + private static final String CONTENT_NAME = "content"; + + private final ModelConfigAdapter model = new ModelConfigAdapter(); + + public JsonObject adaptToJson( + SseRequestConfig path) + { + JsonObjectBuilder object = Json.createObjectBuilder(); + if (path.path != null) + { + object.add(PATH_NAME, path.path); + } + if (path.content != null) + { + model.adaptType(path.content.model); + JsonValue content = model.adaptToJson(path.content); + object.add(CONTENT_NAME, content); + } + return object.build(); + } + + @Override + public SseRequestConfig adaptFromJson( + JsonObject object) + { + SsePathConfigBuilder builder = SseRequestConfig.builder(); + if (object.containsKey(PATH_NAME)) + { + builder.path(object.getString(PATH_NAME)); + } + if (object.containsKey(CONTENT_NAME)) + { + JsonValue contentJson = object.get(CONTENT_NAME); + builder.content(model.adaptFromJson(contentJson)); + } + return builder.build(); + } +} diff --git a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/stream/SseServerFactory.java b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/stream/SseServerFactory.java index 58534d31c3..98b51a0b30 100644 --- a/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/stream/SseServerFactory.java +++ b/runtime/binding-sse/src/main/java/io/aklivity/zilla/runtime/binding/sse/internal/stream/SseServerFactory.java @@ -26,6 +26,7 @@ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.function.Consumer; +import java.util.function.Function; import java.util.function.LongFunction; import java.util.function.LongSupplier; import java.util.function.LongUnaryOperator; @@ -73,6 +74,9 @@ import io.aklivity.zilla.runtime.engine.budget.BudgetDebitor; import io.aklivity.zilla.runtime.engine.buffer.BufferPool; import io.aklivity.zilla.runtime.engine.config.BindingConfig; +import io.aklivity.zilla.runtime.engine.config.ModelConfig; +import io.aklivity.zilla.runtime.engine.model.ValidatorHandler; +import io.aklivity.zilla.runtime.engine.model.function.ValueConsumer; public final class SseServerFactory implements SseStreamFactory { @@ -164,6 +168,7 @@ public final class SseServerFactory implements SseStreamFactory private final Long2ObjectHashMap bindings; private final Consumer> setHttpResponseHeaders; private final Consumer> setHttpResponseHeadersWithTimestampExt; + private final Function supplyValidator; public SseServerFactory( SseConfiguration config, @@ -184,6 +189,7 @@ public SseServerFactory( this.setHttpResponseHeaders = this::setHttpResponseHeaders; this.setHttpResponseHeadersWithTimestampExt = this::setHttpResponseHeadersWithTimestampExt; this.challengeEventType = new String8FW(config.getChallengeEventType()); + this.supplyValidator = context::supplyValidator; } @Override @@ -300,7 +306,8 @@ public MessageConsumer newInitialSseStream( routedId, initialId, resolved.id, - timestampRequested); + timestampRequested, + binding.supplyModelConfig(path.asString())); server.onNetBegin(begin); server.stream.doAppBegin(traceId, authorization, affinity, scheme, authority, path, lastId8); @@ -327,6 +334,7 @@ private final class SseServer private final long replyId; private final Consumer> setHttpHeaders; private final SseStream stream; + private final ValidatorHandler contentType; private long initialSeq; private long initialAck; @@ -356,7 +364,8 @@ private SseServer( long routedId, long initialId, long resolvedId, - boolean timestampRequested) + boolean timestampRequested, + ModelConfig config) { this.network = network; this.originId = originId; @@ -366,6 +375,7 @@ private SseServer( this.setHttpHeaders = timestampRequested ? setHttpResponseHeadersWithTimestampExt : setHttpResponseHeaders; this.initialCommentPending = initialComment != null; this.stream = new SseStream(routedId, resolvedId, timestampRequested ? SseDataExFW::timestamp : ex -> 0L); + this.contentType = config != null ? supplyValidator.apply(config) : null; } private void onNetMessage( @@ -1039,7 +1049,10 @@ private void onAppData( timestamp = supplyTimestamp.applyAsLong(sseDataEx); } - doEncodeEvent(traceId, authorization, budgetId, reserved, flags, payload, id, type, timestamp); + if (contentType == null || payload != null && validContent(traceId, contentType, payload)) + { + doEncodeEvent(traceId, authorization, budgetId, reserved, flags, payload, id, type, timestamp); + } } } @@ -1239,6 +1252,16 @@ private void flushAppWindow( } } } + + private boolean validContent( + long traceId, + ValidatorHandler contentType, + OctetsFW payload) + { + return contentType == null || + contentType.validate(traceId, routedId, payload.buffer(), payload.offset(), + payload.sizeof(), ValueConsumer.NOP); + } } private final class HttpDecodeHelper diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseConditionConfigAdapterTest.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseConditionConfigAdapterTest.java index 8fe4d14ea4..15355aa10e 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseConditionConfigAdapterTest.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseConditionConfigAdapterTest.java @@ -58,7 +58,9 @@ public void shouldReadCondition() @Test public void shouldWriteCondition() { - SseConditionConfig condition = new SseConditionConfig("/events"); + SseConditionConfig condition = SseConditionConfig.builder() + .path("/events") + .build(); String text = jsonb.toJson(condition); diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseOptionsConfigAdapterTest.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseOptionsConfigAdapterTest.java index 77c1e353a9..b037f07be3 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseOptionsConfigAdapterTest.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/config/SseOptionsConfigAdapterTest.java @@ -58,7 +58,7 @@ public void shouldReadOptions() @Test public void shouldWriteOptions() { - SseOptionsConfig options = new SseOptionsConfig(3000); + SseOptionsConfig options = SseOptionsConfig.builder().retry(3000).build(); String text = jsonb.toJson(options); diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/AdvisoryIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/AdvisoryIT.java index 8f0231c9c0..cf81f7c883 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/AdvisoryIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/AdvisoryIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/ByteOrderMarkIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/ByteOrderMarkIT.java index f3480a8c5e..c22c0d4372 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/ByteOrderMarkIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/ByteOrderMarkIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/DataIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/DataIT.java index c42a761436..3571622686 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/DataIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/DataIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/EndOfLineIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/EndOfLineIT.java index deed2563a5..3ef801acca 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/EndOfLineIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/EndOfLineIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/ErrorIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/ErrorIT.java index a091196951..5719f9a423 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/ErrorIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/ErrorIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/HandshakeIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/HandshakeIT.java index 6e33f4fdf9..e807bb9590 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/HandshakeIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/HandshakeIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/ReconnectIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/ReconnectIT.java index 377ba88b33..5b2e9c5377 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/ReconnectIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/ReconnectIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/TypeIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/TypeIT.java index f115e327fd..954f090235 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/TypeIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/client/TypeIT.java @@ -24,10 +24,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/AdvisoryIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/AdvisoryIT.java index 19aa21e0af..bc1263b88c 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/AdvisoryIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/AdvisoryIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/ChallengeIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/ChallengeIT.java index a5f7800331..190822af56 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/ChallengeIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/ChallengeIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/DataIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/DataIT.java index 8033f9be7b..4d7e5eb9d0 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/DataIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/DataIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; @@ -78,6 +78,26 @@ public void shouldReceiveMultipleMessages() throws Exception k3po.finish(); } + @Test + @Configuration("server.validator.yaml") + @Specification({ + "${net}/valid/request", + "${app}/valid/server" }) + public void shouldReceiveValidMessage() throws Exception + { + k3po.finish(); + } + + @Test + @Configuration("server.validator.yaml") + @Specification({ + "${net}/invalid/request", + "${app}/invalid/server" }) + public void shouldNotReceiveInvalidMessage() throws Exception + { + k3po.finish(); + } + @Test @Configuration("server.when.yaml") @Specification({ diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/ErrorIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/ErrorIT.java index d0ec0e9cf3..786f7378b4 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/ErrorIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/ErrorIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/HandshakeIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/HandshakeIT.java index e15d239c4b..52b26d9702 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/HandshakeIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/HandshakeIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/IdIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/IdIT.java index 72111649d7..98a7087d6c 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/IdIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/IdIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/ReconnectIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/ReconnectIT.java index 11ca12284e..ecb9820343 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/ReconnectIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/ReconnectIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/TimestampIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/TimestampIT.java index a77dd58a57..b56f94c4b3 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/TimestampIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/TimestampIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/TypeIT.java b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/TypeIT.java index 6742fb2209..4c8532a692 100644 --- a/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/TypeIT.java +++ b/runtime/binding-sse/src/test/java/io/aklivity/zilla/runtime/binding/sse/internal/streams/server/TypeIT.java @@ -24,10 +24,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-tcp/pom.xml b/runtime/binding-tcp/pom.xml index 10862b2bb1..0218e69b1d 100644 --- a/runtime/binding-tcp/pom.xml +++ b/runtime/binding-tcp/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.88 0 @@ -81,8 +79,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -91,8 +89,8 @@ test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -196,7 +194,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java b/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java index 5fd1716db2..8ac83a0afe 100644 --- a/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java +++ b/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java @@ -26,8 +26,6 @@ public final class TcpEventFormatter implements EventFormatterSpi { - private static final String DNS_FAILED_FORMAT = "DNS_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final TcpEventExFW tcpEventExRO = new TcpEventExFW(); @@ -50,7 +48,7 @@ public String format( case DNS_FAILED: { final TcpDnsFailedExFW ex = extension.dnsFailed(); - result = String.format(DNS_FAILED_FORMAT, asString(ex.address())); + result = String.format("Unable to resolve host dns for address (%s).", asString(ex.address())); break; } } diff --git a/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/stream/TcpServerFactory.java b/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/stream/TcpServerFactory.java index bfbc4b13fc..759948e2ad 100644 --- a/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/stream/TcpServerFactory.java +++ b/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/stream/TcpServerFactory.java @@ -582,8 +582,7 @@ private void onAppReset( final long traceId = reset.traceId(); assert acknowledge <= sequence; - assert sequence <= initialSeq; - assert acknowledge >= initialAck; + // assert acknowledge >= initialAck; initialAck = acknowledge; diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/bench/TcpServerBM.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/bench/TcpServerBM.java index 30769b513f..caacfee24d 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/bench/TcpServerBM.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/bench/TcpServerBM.java @@ -77,7 +77,7 @@ public class TcpServerBM public void reinit() throws Exception { engine.start(); - //routedId = controller.route(RouteKind.SERVER, "127.0.0.1:8080", "tcp#0").get(); + //routedId = controller.route(RouteKind.SERVER, "127.0.0.1:12345", "tcp#0").get(); } @TearDown(Level.Trial) @@ -112,7 +112,7 @@ public GroupState() public void init() throws Exception { channel = SocketChannel.open(); - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); channel.configureBlocking(false); } diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/config/TcpConditionConfigAdapterTest.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/config/TcpConditionConfigAdapterTest.java index 8a095f9371..fa1ab19618 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/config/TcpConditionConfigAdapterTest.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/config/TcpConditionConfigAdapterTest.java @@ -49,7 +49,7 @@ public void shouldReadCondition() "{" + "\"cidr\": \"127.0.0.0/24\"," + "\"authority\": \"*.example.net\"," + - "\"port\": 8080" + + "\"port\": 12345" + "}"; TcpConditionConfig condition = jsonb.fromJson(text, TcpConditionConfig.class); @@ -59,7 +59,7 @@ public void shouldReadCondition() assertThat(condition.authority, equalTo("*.example.net")); assertThat(condition.ports, not(nullValue())); assertThat(condition.ports.length, equalTo(1)); - assertThat(condition.ports[0], equalTo(8080)); + assertThat(condition.ports[0], equalTo(12345)); } @Test @@ -69,13 +69,13 @@ public void shouldWriteCondition() .inject(identity()) .cidr("127.0.0.0/24") .authority("*.example.net") - .ports(new int[] { 8080 }) + .ports(new int[] { 12345 }) .build(); String text = jsonb.toJson(condition); assertThat(text, not(nullValue())); - assertThat(text, equalTo("{\"cidr\":\"127.0.0.0/24\",\"authority\":\"*.example.net\",\"port\":8080}")); + assertThat(text, equalTo("{\"cidr\":\"127.0.0.0/24\",\"authority\":\"*.example.net\",\"port\":12345}")); } @Test @@ -85,7 +85,7 @@ public void shouldReadConditionWithPortRange() "{" + "\"cidr\": \"127.0.0.0/24\"," + "\"authority\": \"*.example.net\"," + - "\"port\": 8080-8081" + + "\"port\": 12345-12346" + "}"; TcpConditionConfig condition = jsonb.fromJson(text, TcpConditionConfig.class); @@ -93,8 +93,8 @@ public void shouldReadConditionWithPortRange() assertThat(condition, not(nullValue())); assertThat(condition.ports, not(nullValue())); assertThat(condition.ports.length, equalTo(2)); - assertThat(condition.ports[0], equalTo(8080)); - assertThat(condition.ports[1], equalTo(8081)); + assertThat(condition.ports[0], equalTo(12345)); + assertThat(condition.ports[1], equalTo(12346)); } @Test @@ -104,7 +104,7 @@ public void shouldReadConditionWithPortRangeSingleton() "{" + "\"cidr\": \"127.0.0.0/24\"," + "\"authority\": \"*.example.net\"," + - "\"port\": \"8080\"" + + "\"port\": \"12345\"" + "}"; TcpConditionConfig condition = jsonb.fromJson(text, TcpConditionConfig.class); @@ -112,6 +112,6 @@ public void shouldReadConditionWithPortRangeSingleton() assertThat(condition, not(nullValue())); assertThat(condition.ports, not(nullValue())); assertThat(condition.ports.length, equalTo(1)); - assertThat(condition.ports[0], equalTo(8080)); + assertThat(condition.ports[0], equalTo(12345)); } } diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/config/TcpOptionsConfigAdapterTest.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/config/TcpOptionsConfigAdapterTest.java index 7a0e9db8cf..9b747503af 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/config/TcpOptionsConfigAdapterTest.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/config/TcpOptionsConfigAdapterTest.java @@ -48,7 +48,7 @@ public void shouldReadOptions() String text = "{" + "\"host\": \"localhost\"," + - "\"port\": 8080" + + "\"port\": 12345" + "}"; TcpOptionsConfig options = jsonb.fromJson(text, TcpOptionsConfig.class); @@ -57,7 +57,7 @@ public void shouldReadOptions() assertThat(options.host, equalTo("localhost")); assertThat(options.ports, not(nullValue())); assertThat(options.ports.length, equalTo(1)); - assertThat(options.ports[0], equalTo(8080)); + assertThat(options.ports[0], equalTo(12345)); } @Test @@ -66,7 +66,7 @@ public void shouldReadOptionsWithPortRange() String text = "{" + "\"host\": \"localhost\"," + - "\"port\": \"8080-8081\"" + + "\"port\": \"12345-12346\"" + "}"; TcpOptionsConfig options = jsonb.fromJson(text, TcpOptionsConfig.class); @@ -75,8 +75,8 @@ public void shouldReadOptionsWithPortRange() assertThat(options.host, equalTo("localhost")); assertThat(options.ports, not(nullValue())); assertThat(options.ports.length, equalTo(2)); - assertThat(options.ports[0], equalTo(8080)); - assertThat(options.ports[1], equalTo(8081)); + assertThat(options.ports[0], equalTo(12345)); + assertThat(options.ports[1], equalTo(12346)); } @Test @@ -85,7 +85,7 @@ public void shouldReadOptionsWithPortRangeSingleton() String text = "{" + "\"host\": \"localhost\"," + - "\"port\": \"8080\"" + + "\"port\": \"12345\"" + "}"; TcpOptionsConfig options = jsonb.fromJson(text, TcpOptionsConfig.class); @@ -94,7 +94,7 @@ public void shouldReadOptionsWithPortRangeSingleton() assertThat(options.host, equalTo("localhost")); assertThat(options.ports, not(nullValue())); assertThat(options.ports.length, equalTo(1)); - assertThat(options.ports[0], equalTo(8080)); + assertThat(options.ports[0], equalTo(12345)); } @Test @@ -103,13 +103,13 @@ public void shouldWriteOptions() TcpOptionsConfig options = TcpOptionsConfig.builder() .inject(identity()) .host("localhost") - .ports(new int[] { 8080 }) + .ports(new int[] { 12345 }) .build(); String text = jsonb.toJson(options); assertThat(text, not(nullValue())); - assertThat(text, equalTo("{\"host\":\"localhost\",\"port\":8080}")); + assertThat(text, equalTo("{\"host\":\"localhost\",\"port\":12345}")); } @Test @@ -118,7 +118,7 @@ public void shouldReadOptionsWithBacklog() String text = "{" + "\"host\": \"localhost\"," + - "\"port\": 8080," + + "\"port\": 12345," + "\"backlog\": 1000" + "}"; @@ -128,7 +128,7 @@ public void shouldReadOptionsWithBacklog() assertThat(options.host, equalTo("localhost")); assertThat(options.ports, not(nullValue())); assertThat(options.ports.length, equalTo(1)); - assertThat(options.ports[0], equalTo(8080)); + assertThat(options.ports[0], equalTo(12345)); assertThat(options.backlog, equalTo(1000)); } @@ -138,13 +138,13 @@ public void shouldWriteOptionsWithBacklog() TcpOptionsConfig options = TcpOptionsConfig.builder() .inject(identity()) .host("localhost") - .ports(new int[] { 8080 }) + .ports(new int[] { 12345 }) .backlog(1000) .build(); String text = jsonb.toJson(options); assertThat(text, not(nullValue())); - assertThat(text, equalTo("{\"host\":\"localhost\",\"port\":8080,\"backlog\":1000}")); + assertThat(text, equalTo("{\"host\":\"localhost\",\"port\":12345,\"backlog\":1000}")); } } diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientIOExceptionFromReadIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientIOExceptionFromReadIT.java index 59073e4b8c..e545ceac3d 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientIOExceptionFromReadIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientIOExceptionFromReadIT.java @@ -29,9 +29,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; @@ -61,7 +61,7 @@ public void shouldReportIOExceptionFromReadAsAbortAndReset() throws Exception try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); @@ -87,7 +87,7 @@ public void shouldNotResetWhenProcessingEndAfterIOExceptionFromRead() throws Exc try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientIOExceptionFromWriteIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientIOExceptionFromWriteIT.java index 6d7e53a22b..d66090dc59 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientIOExceptionFromWriteIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientIOExceptionFromWriteIT.java @@ -32,9 +32,9 @@ import org.junit.rules.TestRule; import org.junit.rules.Timeout; import org.junit.runner.RunWith; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper.OnDataHelper; import io.aklivity.zilla.runtime.engine.test.EngineRule; @@ -75,7 +75,7 @@ public void shouldAbortAndResetWhenImmediateWriteThrowsIOException() throws Exce try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); @@ -112,7 +112,7 @@ public void shouldAbortAndResetWhenDeferredWriteThrowsIOException() throws Excep try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientIT.java index 5373187431..b17c814cf2 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientIT.java @@ -33,10 +33,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; @@ -135,7 +135,7 @@ public void shouldReceiveClientSentDataAndEnd() throws Exception try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); @@ -167,7 +167,7 @@ public void shouldWriteDataAfterReceivingEndOfRead() throws Exception try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); @@ -202,7 +202,7 @@ public void shouldEstablishConnection() throws Exception "${app}/connection.established.ipv6/client", "${net}/connection.established/server" }) - @ScriptProperty("address \"tcp://[::1]:8080\"") + @ScriptProperty("address \"tcp://[::1]:12345\"") public void shouldEstablishConnectionIPv6() throws Exception { k3po.finish(); @@ -297,7 +297,7 @@ public void shouldReceiveServerSentDataAndEnd() throws Exception try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); @@ -323,7 +323,7 @@ public void shouldWriteDataAfterReceiveEnd() throws Exception try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientLimitsIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientLimitsIT.java index da7a350a5b..885ca799da 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientLimitsIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientLimitsIT.java @@ -31,9 +31,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; @@ -64,7 +64,7 @@ public void shouldResetWhenWindowExceeded() throws Exception try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientPartialWriteIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientPartialWriteIT.java index 7ca8935eb4..9cd6b6ca93 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientPartialWriteIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientPartialWriteIT.java @@ -42,9 +42,9 @@ import org.junit.rules.TestRule; import org.junit.rules.Timeout; import org.junit.runner.RunWith; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper.HandleWriteHelper; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper.OnDataHelper; @@ -142,7 +142,7 @@ public void shouldHandleEndOfStreamWithPendingWrite() throws Exception try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientPartialWriteLimitsIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientPartialWriteLimitsIT.java index 021a27a73a..b17bf0a13c 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientPartialWriteLimitsIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientPartialWriteLimitsIT.java @@ -42,9 +42,9 @@ import org.junit.rules.TestRule; import org.junit.rules.Timeout; import org.junit.runner.RunWith; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper.HandleWriteHelper; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper.OnDataHelper; @@ -104,7 +104,7 @@ public void shouldResetStreamsExceedingPartialWriteStreamsLimit() throws Excepti try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientResetAndAbortIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientResetAndAbortIT.java index 7a971cd62c..63a38676a7 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientResetAndAbortIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientResetAndAbortIT.java @@ -33,9 +33,9 @@ import org.junit.rules.TestRule; import org.junit.rules.Timeout; import org.junit.runner.RunWith; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper.CountDownHelper; import io.aklivity.zilla.runtime.engine.test.EngineRule; @@ -69,7 +69,7 @@ public void shouldShutdownOutputWhenClientSendsAbort() throws Exception try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); @@ -106,7 +106,7 @@ public void shouldShutdownOutputAndInputWhenClientSendsAbortAndReset() throws Ex try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); @@ -144,7 +144,7 @@ public void shouldShutdownInputWhenClientSendsReset() throws Exception try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); @@ -185,7 +185,7 @@ public void shouldShutdownOutputAndInputWhenClientSendsResetAndEnd() throws Exce try (ServerSocketChannel server = ServerSocketChannel.open()) { server.setOption(SO_REUSEADDR, true); - server.bind(new InetSocketAddress("127.0.0.1", 8080)); + server.bind(new InetSocketAddress("127.0.0.1", 12345)); k3po.start(); diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientRoutingIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientRoutingIT.java index a2aad7fa70..a9c30499c6 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientRoutingIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ClientRoutingIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/EventIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/EventIT.java index 95917fb03a..de45dcc29b 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/EventIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/EventIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerIOExceptionFromReadIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerIOExceptionFromReadIT.java index 2906d2505e..63101f2cef 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerIOExceptionFromReadIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerIOExceptionFromReadIT.java @@ -28,9 +28,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; @@ -63,7 +63,7 @@ public void shouldReportIOExceptionFromReadAsAbortAndReset() throws Exception try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); k3po.awaitBarrier("CONNECTED"); @@ -84,7 +84,7 @@ public void shouldNotResetWhenProcessingEndAfterIOExceptionFromRead() throws Exc try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); k3po.awaitBarrier("CONNECTED"); diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerIOExceptionFromWriteIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerIOExceptionFromWriteIT.java index 87e9c706d9..8740765b0a 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerIOExceptionFromWriteIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerIOExceptionFromWriteIT.java @@ -30,9 +30,9 @@ import org.junit.rules.TestRule; import org.junit.rules.Timeout; import org.junit.runner.RunWith; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper.OnDataHelper; import io.aklivity.zilla.runtime.engine.test.EngineRule; @@ -74,7 +74,7 @@ public void shouldResetWhenImmediateWriteThrowsIOException() throws Exception try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); k3po.finish(); } @@ -107,7 +107,7 @@ public void shouldResetWhenDeferredWriteThrowsIOException() throws Exception try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); k3po.finish(); } diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerIT.java index e28612865c..b22d64a3c0 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerIT.java @@ -35,10 +35,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; @@ -152,7 +152,7 @@ public void shouldReceiveClientSentDataAndEnd() throws Exception try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); channel.write(UTF_8.encode("client data")); channel.shutdownOutput(); @@ -172,7 +172,7 @@ public void shouldWriteDataAfterReceiveEnd() throws Exception try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); channel.shutdownOutput(); ByteBuffer buf = ByteBuffer.allocate(256); @@ -214,7 +214,7 @@ public void shouldEstablishConnection() throws Exception "${app}/connection.established/server", "${net}/connection.established/client" }) - @ScriptProperty("address \"tcp://0.0.0.0:8080\"") + @ScriptProperty("address \"tcp://0.0.0.0:12345\"") public void shouldEstablishConnectionToAddressAnyIPv4() throws Exception { k3po.finish(); @@ -227,7 +227,7 @@ public void shouldEstablishConnectionToAddressAnyIPv4() throws Exception "${app}/connection.established.ipv6/server", "${net}/connection.established/client" }) - @ScriptProperty("address \"tcp://[::0]:8080\"") + @ScriptProperty("address \"tcp://[::0]:12345\"") public void shouldEstablishConnectionToAddressAnyIPv6() throws Exception { k3po.finish(); @@ -244,7 +244,7 @@ public void connectionFailed() throws Exception try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); ByteBuffer buf = ByteBuffer.allocate(256); try @@ -289,7 +289,7 @@ public void shouldNotGetRepeatedIOExceptionsFromReaderStreamRead() throws Except { k3po.start(); - try (Socket socket = new Socket("127.0.0.1", 8080)) + try (Socket socket = new Socket("127.0.0.1", 12345)) { socket.shutdownInput(); Thread.sleep(500); @@ -332,7 +332,7 @@ public void shouldReceiveServerSentDataAndEnd() throws Exception try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); ByteBuffer buf = ByteBuffer.allocate(256); channel.read(buf); @@ -361,7 +361,7 @@ public void shouldReceiveDataAfterSendingEnd() throws Exception try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); ByteBuffer buf = ByteBuffer.allocate(256); int len = channel.read(buf); @@ -385,13 +385,13 @@ public void shouldUnbindRebind() throws Exception k3po.start(); SocketChannel channel1 = SocketChannel.open(); - channel1.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel1.connect(new InetSocketAddress("127.0.0.1", 12345)); SocketChannel channel2 = SocketChannel.open(); - channel2.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel2.connect(new InetSocketAddress("127.0.0.1", 12345)); SocketChannel channel3 = SocketChannel.open(); - channel3.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel3.connect(new InetSocketAddress("127.0.0.1", 12345)); k3po.awaitBarrier("CONNECTION_ACCEPTED_1"); k3po.awaitBarrier("CONNECTION_ACCEPTED_2"); @@ -400,7 +400,7 @@ public void shouldUnbindRebind() throws Exception SocketChannel channel4 = SocketChannel.open(); try { - channel4.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel4.connect(new InetSocketAddress("127.0.0.1", 12345)); fail("4th connect shouldn't succeed as max.connections = 3"); } catch (IOException ioe) @@ -417,7 +417,7 @@ public void shouldUnbindRebind() throws Exception Thread.sleep(200); SocketChannel channel5 = SocketChannel.open(); - channel5.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel5.connect(new InetSocketAddress("127.0.0.1", 12345)); k3po.awaitBarrier("CONNECTION_ACCEPTED_4"); channel2.close(); diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerLimitsIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerLimitsIT.java index 3a9c40cc29..1e6614a9ec 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerLimitsIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerLimitsIT.java @@ -30,9 +30,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; @@ -65,7 +65,7 @@ public void shouldResetWhenWindowIsExceeded() throws Exception try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); int len; try diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerPartialWriteIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerPartialWriteIT.java index f7979d5fdf..6b1b0c1e0c 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerPartialWriteIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerPartialWriteIT.java @@ -40,9 +40,9 @@ import org.junit.rules.TestRule; import org.junit.rules.Timeout; import org.junit.runner.RunWith; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper.HandleWriteHelper; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper.OnDataHelper; @@ -161,7 +161,7 @@ public void shouldHandleEndOfStreamWithPendingWrite() throws Exception try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); k3po.awaitBarrier("END_WRITTEN"); endWritten.set(true); diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerPartialWriteLimitsIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerPartialWriteLimitsIT.java index f001f4c2d3..ed2fa6cbff 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerPartialWriteLimitsIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerPartialWriteLimitsIT.java @@ -40,9 +40,9 @@ import org.junit.rules.TestRule; import org.junit.rules.Timeout; import org.junit.runner.RunWith; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper.HandleWriteHelper; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper.OnDataHelper; @@ -105,8 +105,8 @@ public void shouldResetStreamsExceedingPartialWriteStreamsLimit() throws Excepti try (SocketChannel channel1 = SocketChannel.open(); SocketChannel channel2 = SocketChannel.open()) { - channel1.connect(new InetSocketAddress("127.0.0.1", 8080)); - channel2.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel1.connect(new InetSocketAddress("127.0.0.1", 12345)); + channel2.connect(new InetSocketAddress("127.0.0.1", 12345)); k3po.awaitBarrier("SECOND_STREAM_RESET_RECEIVED"); resetReceived.set(true); diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerResetAndAbortIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerResetAndAbortIT.java index be07c9ef63..026707b1cd 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerResetAndAbortIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerResetAndAbortIT.java @@ -32,9 +32,9 @@ import org.junit.rules.TestRule; import org.junit.rules.Timeout; import org.junit.runner.RunWith; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper; import io.aklivity.zilla.runtime.binding.tcp.internal.SocketChannelHelper.CountDownHelper; import io.aklivity.zilla.runtime.engine.test.EngineRule; @@ -70,7 +70,7 @@ public void shouldShutdownOutputWhenServerSendsAbort() throws Exception try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); ByteBuffer buf = ByteBuffer.allocate(20); int len = channel.read(buf); @@ -102,7 +102,7 @@ public void shouldShutdownOutputAndInputWhenServerSendsAbortAndReset() throws Ex try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); ByteBuffer buf = ByteBuffer.allocate(20); int len = channel.read(buf); @@ -135,7 +135,7 @@ public void shouldShutdownInputWhenServerSendsReset() throws Exception try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); channel.configureBlocking(false); @@ -177,7 +177,7 @@ public void shouldShutdownOutputAndInputWhenServerSendsResetAndEnd() throws Exce try (SocketChannel channel = SocketChannel.open()) { - channel.connect(new InetSocketAddress("127.0.0.1", 8080)); + channel.connect(new InetSocketAddress("127.0.0.1", 12345)); ByteBuffer buf = ByteBuffer.allocate(20); int len = channel.read(buf); diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerRoutingIT.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerRoutingIT.java index 27b80370fc..700dc7b74a 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerRoutingIT.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/streams/ServerRoutingIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/util/IpUtilTest.java b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/util/IpUtilTest.java index 62481b1398..f5437ac1e6 100644 --- a/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/util/IpUtilTest.java +++ b/runtime/binding-tcp/src/test/java/io/aklivity/zilla/runtime/binding/tcp/internal/util/IpUtilTest.java @@ -30,48 +30,48 @@ public final class IpUtilTest @Test public void shouldMatchAddressesSameAddressAndPort() throws Exception { - InetSocketAddress address1 = new InetSocketAddress(InetAddress.getLocalHost(), 8080); - InetSocketAddress address2 = new InetSocketAddress(InetAddress.getLocalHost(), 8080); + InetSocketAddress address1 = new InetSocketAddress(InetAddress.getLocalHost(), 12345); + InetSocketAddress address2 = new InetSocketAddress(InetAddress.getLocalHost(), 12345); assertEquals(0, IpUtil.compareAddresses(address1, address2)); } @Test public void shouldMatchAddressesFirstIsAny() throws Exception { - InetSocketAddress address1 = new InetSocketAddress(8080); - InetSocketAddress address2 = new InetSocketAddress(InetAddress.getLocalHost(), 8080); + InetSocketAddress address1 = new InetSocketAddress(12345); + InetSocketAddress address2 = new InetSocketAddress(InetAddress.getLocalHost(), 12345); assertEquals(0, IpUtil.compareAddresses(address1, address2)); } @Test public void shouldMatchAddressesSecondIsAny() throws Exception { - InetSocketAddress address1 = new InetSocketAddress(getLocalHost(), 8080); - InetSocketAddress address2 = new InetSocketAddress(8080); + InetSocketAddress address1 = new InetSocketAddress(getLocalHost(), 12345); + InetSocketAddress address2 = new InetSocketAddress(12345); assertEquals(0, IpUtil.compareAddresses(address1, address2)); } @Test public void shouldNotMatchAddressesDifferentPort() throws Exception { - InetSocketAddress address1 = new InetSocketAddress(InetAddress.getLocalHost(), 8080); - InetSocketAddress address2 = new InetSocketAddress(InetAddress.getLocalHost(), 8081); + InetSocketAddress address1 = new InetSocketAddress(InetAddress.getLocalHost(), 12345); + InetSocketAddress address2 = new InetSocketAddress(InetAddress.getLocalHost(), 12346); assertFalse(0 == IpUtil.compareAddresses(address1, address2)); } @Test public void shouldNotMatchAddressesFirstIsAnyDifferentPort() throws Exception { - InetSocketAddress address1 = new InetSocketAddress(8080); - InetSocketAddress address2 = new InetSocketAddress(InetAddress.getLocalHost(), 8081); + InetSocketAddress address1 = new InetSocketAddress(12345); + InetSocketAddress address2 = new InetSocketAddress(InetAddress.getLocalHost(), 12346); assertFalse(0 == IpUtil.compareAddresses(address1, address2)); } @Test public void shouldNotMatchAddressesSecondIsAnyDifferentPort() throws Exception { - InetSocketAddress address1 = new InetSocketAddress(InetAddress.getLocalHost(), 8081); - InetSocketAddress address2 = new InetSocketAddress(8080); + InetSocketAddress address1 = new InetSocketAddress(InetAddress.getLocalHost(), 12346); + InetSocketAddress address2 = new InetSocketAddress(12345); assertFalse(0 == IpUtil.compareAddresses(address1, address2)); } diff --git a/runtime/binding-tls/pom.xml b/runtime/binding-tls/pom.xml index c23c9a7439..74eb70c45b 100644 --- a/runtime/binding-tls/pom.xml +++ b/runtime/binding-tls/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,9 +24,7 @@ - 11 - 11 - 0.75 + 0.74 0 @@ -77,13 +75,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -192,7 +190,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java b/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java index 49a03c9cb5..992946d7f6 100644 --- a/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java +++ b/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java @@ -24,12 +24,6 @@ public final class TlsEventFormatter implements EventFormatterSpi { - private static final String TLS_FAILED_FORMAT = "TLS_FAILED"; - private static final String PROTOCOL_REJECTED_FORMAT = "PROTOCOL_REJECTED"; - private static final String KEY_REJECTED_FORMAT = "KEY_REJECTED"; - private static final String PEER_NOT_VERIFIED_FORMAT = "PEER_NOT_VERIFIED"; - private static final String HANDSHAKE_FAILED_FORMAT = "HANDSHAKE_FAILED"; - private final EventFW eventRO = new EventFW(); private final TlsEventExFW tlsEventExRO = new TlsEventExFW(); @@ -51,27 +45,27 @@ public String format( { case TLS_FAILED: { - result = TLS_FAILED_FORMAT; + result = "There was a generic error detected by an SSL subsystem."; break; } case TLS_PROTOCOL_REJECTED: { - result = PROTOCOL_REJECTED_FORMAT; + result = "There was an error in the operation of the SSL protocol."; break; } case TLS_KEY_REJECTED: { - result = KEY_REJECTED_FORMAT; + result = "Bad SSL key due to misconfiguration of the server or client SSL certificate and private key."; break; } case TLS_PEER_NOT_VERIFIED: { - result = PEER_NOT_VERIFIED_FORMAT; + result = "The peer's identity could not be verified."; break; } case TLS_HANDSHAKE_FAILED: { - result = HANDSHAKE_FAILED_FORMAT; + result = "The client and server could not negotiate the desired level of security."; break; } } diff --git a/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/stream/TlsClientFactory.java b/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/stream/TlsClientFactory.java index b111b35b77..3ad8e84a0e 100644 --- a/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/stream/TlsClientFactory.java +++ b/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/stream/TlsClientFactory.java @@ -52,7 +52,6 @@ import io.aklivity.zilla.runtime.binding.tls.internal.config.TlsBindingConfig; import io.aklivity.zilla.runtime.binding.tls.internal.config.TlsRouteConfig; import io.aklivity.zilla.runtime.binding.tls.internal.types.OctetsFW; -import io.aklivity.zilla.runtime.binding.tls.internal.types.OctetsFW.Builder; import io.aklivity.zilla.runtime.binding.tls.internal.types.codec.TlsRecordInfoFW; import io.aklivity.zilla.runtime.binding.tls.internal.types.codec.TlsUnwrappedDataFW; import io.aklivity.zilla.runtime.binding.tls.internal.types.codec.TlsUnwrappedInfoFW; @@ -376,7 +375,7 @@ private void doEnd( int maximum, long traceId, long authorization, - Consumer extension) + Consumer extension) { final EndFW end = endRW.wrap(writeBuffer, 0, writeBuffer.capacity()) .originId(originId) @@ -403,7 +402,7 @@ private void doAbort( int maximum, long traceId, long authorization, - Consumer extension) + Consumer extension) { final AbortFW abort = abortRW.wrap(writeBuffer, 0, writeBuffer.capacity()) .originId(originId) diff --git a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/bench/TlsWorker.java b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/bench/TlsWorker.java index 8f0ad77e20..43cafdddf0 100644 --- a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/bench/TlsWorker.java +++ b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/bench/TlsWorker.java @@ -18,12 +18,10 @@ import static io.aklivity.zilla.runtime.engine.internal.stream.StreamId.isInitial; import static java.lang.ThreadLocal.withInitial; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.agrona.LangUtil.rethrowUnchecked; import java.net.InetAddress; -import java.net.MalformedURLException; -import java.net.URL; import java.nio.channels.SelectableChannel; +import java.nio.file.Path; import java.time.Clock; import java.util.function.IntConsumer; import java.util.function.LongSupplier; @@ -85,7 +83,7 @@ public class TlsWorker implements EngineContext private final BindingFactory factory; private final VaultFactory vaultFactory; private final Configuration config; - private final URL configURL; + private final Path configPath; private final TlsSignaler signaler; @@ -105,7 +103,7 @@ public TlsWorker( .readonly(false) .build() .bufferPool(); - this.configURL = config.configURL(); + this.configPath = Path.of(config.configURI()); this.signaler = new TlsSignaler(); @@ -331,6 +329,13 @@ public int supplyEventId( return 0; } + @Override + public String supplyEventName( + int eventId) + { + return ""; + } + @Override public BindingHandler streamFactory() { @@ -380,19 +385,10 @@ public ConverterHandler supplyWriteConverter( } @Override - public URL resolvePath( - String path) + public Path resolvePath( + String location) { - URL resolved = null; - try - { - resolved = new URL(configURL, path); - } - catch (MalformedURLException ex) - { - rethrowUnchecked(ex); - } - return resolved; + return configPath.resolveSibling(location); } @Override diff --git a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/BridgeIT.java b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/BridgeIT.java index e8ebe71339..2947e76835 100644 --- a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/BridgeIT.java +++ b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/BridgeIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ClientFragmentedIT.java b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ClientFragmentedIT.java index b0fee23e02..71e2449562 100644 --- a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ClientFragmentedIT.java +++ b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ClientFragmentedIT.java @@ -23,10 +23,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.tls.internal.TlsConfigurationTest; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ClientIT.java b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ClientIT.java index 5014f76995..2a338ec4ab 100644 --- a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ClientIT.java +++ b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ClientIT.java @@ -27,10 +27,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.tls.internal.TlsConfigurationTest; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ProxyIT.java b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ProxyIT.java index b799066944..1135b92a64 100644 --- a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ProxyIT.java +++ b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ProxyIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ServerFragmentedIT.java b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ServerFragmentedIT.java index 0dfc80fdb1..0ddee7149f 100644 --- a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ServerFragmentedIT.java +++ b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ServerFragmentedIT.java @@ -23,10 +23,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.tls.internal.TlsConfigurationTest; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ServerIT.java b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ServerIT.java index 83c4a3b84d..eea461d110 100644 --- a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ServerIT.java +++ b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/streams/ServerIT.java @@ -26,9 +26,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.binding.tls.internal.TlsConfigurationTest; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-ws/pom.xml b/runtime/binding-ws/pom.xml index 09d2a56dc6..c23f7b8dd2 100644 --- a/runtime/binding-ws/pom.xml +++ b/runtime/binding-ws/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.72 0 @@ -66,13 +64,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -167,7 +165,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/AdvisoryIT.java b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/AdvisoryIT.java index f7d22301f7..284fd99cc5 100644 --- a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/AdvisoryIT.java +++ b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/AdvisoryIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/BaseFramingIT.java b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/BaseFramingIT.java index ec8640c9b1..855fd32bdb 100644 --- a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/BaseFramingIT.java +++ b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/BaseFramingIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/ControlIT.java b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/ControlIT.java index 70b48b76be..057c7571d2 100644 --- a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/ControlIT.java +++ b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/ControlIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/FlowControlIT.java b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/FlowControlIT.java index 7436b35fba..96fd865230 100644 --- a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/FlowControlIT.java +++ b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/FlowControlIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/OpeningHandshakeIT.java b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/OpeningHandshakeIT.java index 5ede78693e..b3bcb9dbc8 100644 --- a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/OpeningHandshakeIT.java +++ b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/client/OpeningHandshakeIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/AdvisoryIT.java b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/AdvisoryIT.java index 11d89fc600..c168002903 100644 --- a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/AdvisoryIT.java +++ b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/AdvisoryIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/BaseFramingIT.java b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/BaseFramingIT.java index 9f45297f91..c2aec85a5e 100644 --- a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/BaseFramingIT.java +++ b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/BaseFramingIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/ClosingHandshakeIT.java b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/ClosingHandshakeIT.java index 9b9a8db51e..9b5762d4a2 100644 --- a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/ClosingHandshakeIT.java +++ b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/ClosingHandshakeIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/ControlIT.java b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/ControlIT.java index 85d713574a..c69d8103e1 100644 --- a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/ControlIT.java +++ b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/ControlIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/FlowControlIT.java b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/FlowControlIT.java index 4c3d957554..acd20abb2b 100644 --- a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/FlowControlIT.java +++ b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/FlowControlIT.java @@ -24,9 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/FragmentationIT.java b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/FragmentationIT.java index 5c588bdd56..e434e301ee 100644 --- a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/FragmentationIT.java +++ b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/FragmentationIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/OpeningHandshakeIT.java b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/OpeningHandshakeIT.java index e6e1a55938..5b4441978a 100644 --- a/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/OpeningHandshakeIT.java +++ b/runtime/binding-ws/src/test/java/io/aklivity/zilla/runtime/binding/ws/internal/streams/server/OpeningHandshakeIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/catalog-apicurio/pom.xml b/runtime/catalog-apicurio/pom.xml index ac7224aa51..5e2664fc95 100644 --- a/runtime/catalog-apicurio/pom.xml +++ b/runtime/catalog-apicurio/pom.xml @@ -6,7 +6,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -22,9 +22,7 @@ - 11 - 11 - 0.94 + 0.91 0 @@ -49,13 +47,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -164,7 +162,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioCatalogHandler.java b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioCatalogHandler.java index f73ac4bb3b..80097439c7 100644 --- a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioCatalogHandler.java +++ b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioCatalogHandler.java @@ -375,7 +375,8 @@ public int encode( } @Override - public int encodePadding() + public int encodePadding( + int length) { return MAX_PADDING_LENGTH; } diff --git a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventContext.java b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventContext.java index 85553059b8..91f2f3be23 100644 --- a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventContext.java +++ b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventContext.java @@ -44,7 +44,7 @@ public class ApicurioEventContext private final int staleArtifactID; private final int unretrievableArtifactId; private final int retrievableArtifactSubjectVersionId; - private final int retrievableArtifactId; + private final int retrievedArtifactId; private final MessageConsumer eventWriter; private final Clock clock; @@ -57,8 +57,8 @@ public ApicurioEventContext( this.staleArtifactID = context.supplyEventId("catalog.apicurio.unretrievable.artifact.subject.version.stale.artifact"); this.unretrievableArtifactId = context.supplyEventId("catalog.apicurio.unretrievable.artifact.id"); this.retrievableArtifactSubjectVersionId = context.supplyEventId( - "catalog.apicurio.retrievable.artifact.subject.version"); - this.retrievableArtifactId = context.supplyEventId("catalog.apicurio.retrievable.artifact.id"); + "catalog.apicurio.retrieved.artifact.subject.version"); + this.retrievedArtifactId = context.supplyEventId("catalog.apicurio.retrieved.artifact.id"); this.eventWriter = context.supplyEventWriter(); this.clock = context.clock(); } @@ -142,7 +142,7 @@ public void onRetrievableArtifactSubjectVersion( { ApicurioEventExFW extension = apicurioEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) - .retrievableArtifactSubjectVersion(e -> e + .retrievedArtifactSubjectVersion(e -> e .typeId(RETRIEVED_ARTIFACT_SUBJECT_VERSION.value()) .subject(subject) .version(version) @@ -165,14 +165,14 @@ public void onRetrievableArtifactId( { ApicurioEventExFW extension = apicurioEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) - .retrievableArtifactId(e -> e + .retrievedArtifactId(e -> e .typeId(RETRIEVED_ARTIFACT_ID.value()) .artifactId(artifactId) ) .build(); EventFW event = eventRW .wrap(eventBuffer, 0, eventBuffer.capacity()) - .id(retrievableArtifactId) + .id(retrievedArtifactId) .timestamp(clock.millis()) .traceId(0L) .namespacedId(catalogId) diff --git a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java index 83947114e7..319d9d1d95 100644 --- a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java +++ b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java @@ -18,8 +18,8 @@ import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.StringFW; import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioEventExFW; -import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioRetrievableArtifactIdExFW; -import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioRetrievableArtifactSubjectVersionExFW; +import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioRetrievedArtifactIdExFW; +import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioRetrievedArtifactSubjectVersionExFW; import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioUnretrievableArtifactIdExFW; import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioUnretrievableArtifactSubjectVersionExFW; import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioUnretrievableArtifactSubjectVersionStaleArtifactExFW; @@ -29,13 +29,6 @@ public final class ApicurioEventFormatter implements EventFormatterSpi { - private static final String UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION = "UNRETRIEVABLE_ARTIFACT %s %s"; - private static final String UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT = - "UNRETRIEVABLE_ARTIFACT %s %s, USING_STALE_ARTIFACT %d"; - private static final String UNRETRIEVABLE_ARTIFACT_ID = "UNRETRIEVABLE_ARTIFACT_ID %d"; - private static final String RETRIEVED_ARTIFACT_SUBJECT_VERSION = "RETRIEVED_ARTIFACT_SUBJECT_VERSION %s %s"; - private static final String RETRIEVED_ARTIFACT_ID = "RETRIEVED_ARTIFACT_ID %d"; - private final EventFW eventRO = new EventFW(); private final ApicurioEventExFW schemaRegistryEventExRO = new ApicurioEventExFW(); @@ -58,33 +51,44 @@ public String format( case UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION: { ApicurioUnretrievableArtifactSubjectVersionExFW ex = extension.unretrievableArtifactSubjectVersion(); - result = String.format(UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION, asString(ex.subject()), asString(ex.version())); + result = String.format( + "Unable to fetch artifact for subject %s with version %s.", + asString(ex.subject()), + asString(ex.version()) + ); break; } case UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT: { ApicurioUnretrievableArtifactSubjectVersionStaleArtifactExFW ex = extension .unretrievableArtifactSubjectVersionStaleArtifact(); - result = String.format(UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT, asString(ex.subject()), - asString(ex.version()), ex.artifactId()); + result = String.format( + "Unable to fetch artifact for subject %s with version %s; using stale artifact with id %d.", + asString(ex.subject()), + asString(ex.version()), + ex.artifactId() + ); break; } case UNRETRIEVABLE_ARTIFACT_ID: { ApicurioUnretrievableArtifactIdExFW ex = extension.unretrievableArtifactId(); - result = String.format(UNRETRIEVABLE_ARTIFACT_ID, ex.artifactId()); + result = String.format("Unable to fetch artifact id %d.", ex.artifactId()); break; } case RETRIEVED_ARTIFACT_SUBJECT_VERSION: { - ApicurioRetrievableArtifactSubjectVersionExFW ex = extension.retrievableArtifactSubjectVersion(); - result = String.format(RETRIEVED_ARTIFACT_SUBJECT_VERSION, asString(ex.subject()), asString(ex.version())); + ApicurioRetrievedArtifactSubjectVersionExFW ex = extension.retrievedArtifactSubjectVersion(); + result = String.format("Successfully fetched artifact for subject %s with version %s.", + asString(ex.subject()), + asString(ex.version()) + ); break; } case RETRIEVED_ARTIFACT_ID: { - ApicurioRetrievableArtifactIdExFW ex = extension.retrievableArtifactId(); - result = String.format(RETRIEVED_ARTIFACT_ID, ex.artifactId()); + ApicurioRetrievedArtifactIdExFW ex = extension.retrievedArtifactId(); + result = String.format("Successfully fetched artifact id %d.", ex.artifactId()); break; } } diff --git a/runtime/catalog-apicurio/src/test/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioIT.java b/runtime/catalog-apicurio/src/test/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioIT.java index 5905b7a904..b11d491be3 100644 --- a/runtime/catalog-apicurio/src/test/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioIT.java +++ b/runtime/catalog-apicurio/src/test/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioIT.java @@ -29,9 +29,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.catalog.apicurio.internal.config.ApicurioOptionsConfig; import io.aklivity.zilla.runtime.engine.EngineContext; import io.aklivity.zilla.runtime.engine.catalog.CatalogHandler; @@ -164,7 +164,7 @@ public void shouldVerifyMaxPadding() { ApicurioCatalogHandler catalog = new ApicurioCatalogHandler(config, context, 0L); - assertEquals(9, catalog.encodePadding()); + assertEquals(9, catalog.encodePadding(0)); } @Test diff --git a/incubator/catalog-filesystem.spec/COPYRIGHT b/runtime/catalog-filesystem/COPYRIGHT similarity index 100% rename from incubator/catalog-filesystem.spec/COPYRIGHT rename to runtime/catalog-filesystem/COPYRIGHT diff --git a/incubator/catalog-filesystem.spec/LICENSE b/runtime/catalog-filesystem/LICENSE similarity index 100% rename from incubator/catalog-filesystem.spec/LICENSE rename to runtime/catalog-filesystem/LICENSE diff --git a/incubator/catalog-filesystem/NOTICE b/runtime/catalog-filesystem/NOTICE similarity index 100% rename from incubator/catalog-filesystem/NOTICE rename to runtime/catalog-filesystem/NOTICE diff --git a/incubator/catalog-filesystem/NOTICE.template b/runtime/catalog-filesystem/NOTICE.template similarity index 100% rename from incubator/catalog-filesystem/NOTICE.template rename to runtime/catalog-filesystem/NOTICE.template diff --git a/incubator/catalog-filesystem.spec/mvnw b/runtime/catalog-filesystem/mvnw similarity index 100% rename from incubator/catalog-filesystem.spec/mvnw rename to runtime/catalog-filesystem/mvnw diff --git a/incubator/catalog-filesystem.spec/mvnw.cmd b/runtime/catalog-filesystem/mvnw.cmd similarity index 100% rename from incubator/catalog-filesystem.spec/mvnw.cmd rename to runtime/catalog-filesystem/mvnw.cmd diff --git a/incubator/catalog-filesystem/pom.xml b/runtime/catalog-filesystem/pom.xml similarity index 93% rename from incubator/catalog-filesystem/pom.xml rename to runtime/catalog-filesystem/pom.xml index 68eb226529..604b956d31 100644 --- a/incubator/catalog-filesystem/pom.xml +++ b/runtime/catalog-filesystem/pom.xml @@ -5,13 +5,13 @@ 4.0.0 io.aklivity.zilla - incubator - 0.9.82 + runtime + 0.9.83 ../pom.xml catalog-filesystem - zilla::incubator::catalog-filesystem + zilla::runtime::catalog-filesystem @@ -22,8 +22,6 @@ - 11 - 11 0.80 0 @@ -49,13 +47,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -182,7 +180,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalog.java b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalog.java similarity index 100% rename from incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalog.java rename to runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalog.java diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogContext.java b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogContext.java similarity index 100% rename from incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogContext.java rename to runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogContext.java diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogFactorySpi.java b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogFactorySpi.java similarity index 94% rename from incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogFactorySpi.java rename to runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogFactorySpi.java index 90f0b4984b..550f148f4c 100644 --- a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogFactorySpi.java +++ b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogFactorySpi.java @@ -14,12 +14,10 @@ */ package io.aklivity.zilla.runtime.catalog.filesystem.internal; -import io.aklivity.zilla.runtime.common.feature.Incubating; import io.aklivity.zilla.runtime.engine.Configuration; import io.aklivity.zilla.runtime.engine.catalog.Catalog; import io.aklivity.zilla.runtime.engine.catalog.CatalogFactorySpi; -@Incubating public class FilesystemCatalogFactorySpi implements CatalogFactorySpi { @Override diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogHandler.java b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogHandler.java similarity index 92% rename from incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogHandler.java rename to runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogHandler.java index 4716cff249..681e340594 100644 --- a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogHandler.java +++ b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogHandler.java @@ -15,7 +15,8 @@ package io.aklivity.zilla.runtime.catalog.filesystem.internal; import java.io.InputStream; -import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -34,7 +35,7 @@ public class FilesystemCatalogHandler implements CatalogHandler private final CRC32C crc32c; private final FilesystemEventContext event; private final long catalogId; - private final Function resolvePath; + private final Function resolvePath; public FilesystemCatalogHandler( FilesystemOptionsConfig config, @@ -72,8 +73,8 @@ private void registerSchema( { try { - URL storeURL = resolvePath.apply(config.path); - try (InputStream input = storeURL.openStream()) + Path storePath = resolvePath.apply(config.path); + try (InputStream input = Files.newInputStream(storePath)) { String schema = new String(input.readAllBytes()); int schemaId = generateCRC32C(schema); diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventContext.java b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventContext.java similarity index 100% rename from incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventContext.java rename to runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventContext.java diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java similarity index 86% rename from incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java rename to runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java index 1a64df8309..527bde24d8 100644 --- a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java +++ b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java @@ -25,10 +25,8 @@ public final class FilesystemEventFormatter implements EventFormatterSpi { - private static final String FILE_NOT_FOUND = "FILE_NOT_FOUND %s"; - private final EventFW eventRO = new EventFW(); - private final FilesystemEventExFW schemaRegistryEventExRO = new FilesystemEventExFW(); + private final FilesystemEventExFW filesystemEventExRO = new FilesystemEventExFW(); FilesystemEventFormatter( Configuration config) @@ -41,7 +39,7 @@ public String format( int length) { final EventFW event = eventRO.wrap(buffer, index, index + length); - final FilesystemEventExFW extension = schemaRegistryEventExRO + final FilesystemEventExFW extension = filesystemEventExRO .wrap(event.extension().buffer(), event.extension().offset(), event.extension().limit()); String result = null; switch (extension.kind()) @@ -49,7 +47,7 @@ public String format( case FILE_NOT_FOUND: { FilesystemFileNotFoundExFW ex = extension.fileNotFound(); - result = String.format(FILE_NOT_FOUND, asString(ex.location())); + result = String.format("Unable to find file at (%s) on the host filesystem.", asString(ex.location())); break; } } diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatterFactory.java b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatterFactory.java similarity index 100% rename from incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatterFactory.java rename to runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatterFactory.java diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfig.java b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfig.java similarity index 78% rename from incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfig.java rename to runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfig.java index f396581829..182995f34b 100644 --- a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfig.java +++ b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfig.java @@ -14,6 +14,7 @@ */ package io.aklivity.zilla.runtime.catalog.filesystem.internal.config; +import java.util.LinkedList; import java.util.List; import java.util.function.Function; @@ -37,6 +38,18 @@ public static FilesystemOptionsConfigBuilder builder( public FilesystemOptionsConfig( List subjects) { + super(List.of(), resolveResources(subjects)); this.subjects = subjects; } + + private static List resolveResources( + List subjects) + { + List resources = new LinkedList<>(); + for (FilesystemSchemaConfig subject : subjects) + { + resources.add(subject.path); + } + return resources; + } } diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfigAdapter.java b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfigAdapter.java similarity index 100% rename from incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfigAdapter.java rename to runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfigAdapter.java diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfigBuilder.java b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfigBuilder.java similarity index 100% rename from incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfigBuilder.java rename to runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfigBuilder.java diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemSchemaConfig.java b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemSchemaConfig.java similarity index 100% rename from incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemSchemaConfig.java rename to runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemSchemaConfig.java diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemSchemaConfigBuilder.java b/runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemSchemaConfigBuilder.java similarity index 100% rename from incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemSchemaConfigBuilder.java rename to runtime/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemSchemaConfigBuilder.java diff --git a/incubator/catalog-filesystem/src/main/moditect/module-info.java b/runtime/catalog-filesystem/src/main/moditect/module-info.java similarity index 100% rename from incubator/catalog-filesystem/src/main/moditect/module-info.java rename to runtime/catalog-filesystem/src/main/moditect/module-info.java diff --git a/incubator/catalog-filesystem/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.catalog.CatalogFactorySpi b/runtime/catalog-filesystem/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.catalog.CatalogFactorySpi similarity index 100% rename from incubator/catalog-filesystem/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.catalog.CatalogFactorySpi rename to runtime/catalog-filesystem/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.catalog.CatalogFactorySpi diff --git a/incubator/catalog-filesystem/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.config.OptionsConfigAdapterSpi b/runtime/catalog-filesystem/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.config.OptionsConfigAdapterSpi similarity index 100% rename from incubator/catalog-filesystem/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.config.OptionsConfigAdapterSpi rename to runtime/catalog-filesystem/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.config.OptionsConfigAdapterSpi diff --git a/incubator/catalog-filesystem/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.event.EventFormatterFactorySpi b/runtime/catalog-filesystem/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.event.EventFormatterFactorySpi similarity index 100% rename from incubator/catalog-filesystem/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.event.EventFormatterFactorySpi rename to runtime/catalog-filesystem/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.event.EventFormatterFactorySpi diff --git a/incubator/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/EventIT.java b/runtime/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/EventIT.java similarity index 94% rename from incubator/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/EventIT.java rename to runtime/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/EventIT.java index e7b956eb83..444a6cb253 100644 --- a/incubator/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/EventIT.java +++ b/runtime/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/EventIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/incubator/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogFactoryTest.java b/runtime/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogFactoryTest.java similarity index 92% rename from incubator/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogFactoryTest.java rename to runtime/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogFactoryTest.java index 042367e125..cf3f010b66 100644 --- a/incubator/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogFactoryTest.java +++ b/runtime/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemCatalogFactoryTest.java @@ -21,6 +21,7 @@ import static org.mockito.Mockito.mock; import java.net.URL; +import java.nio.file.Path; import org.junit.Test; import org.mockito.Mockito; @@ -38,7 +39,7 @@ public class FilesystemCatalogFactoryTest { @Test - public void shouldLoadAndCreate() + public void shouldLoadAndCreate() throws Exception { Configuration config = new Configuration(); CatalogFactory factory = CatalogFactory.instantiate(); @@ -50,7 +51,8 @@ public void shouldLoadAndCreate() EngineContext engineContext = mock(EngineContext.class); URL url = FilesystemCatalogFactoryTest.class .getResource("../../../../specs/catalog/filesystem/config/asyncapi/mqtt.yaml"); - Mockito.doReturn(url).when(engineContext).resolvePath("asyncapi/mqtt.yaml"); + Path path = Path.of(url.toURI()); + Mockito.doReturn(path).when(engineContext).resolvePath("asyncapi/mqtt.yaml"); CatalogContext context = catalog.supply(engineContext); assertThat(context, instanceOf(FilesystemCatalogContext.class)); diff --git a/incubator/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemIT.java b/runtime/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemIT.java similarity index 95% rename from incubator/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemIT.java rename to runtime/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemIT.java index 58b6675c2d..9dff743ef2 100644 --- a/incubator/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemIT.java +++ b/runtime/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemIT.java @@ -22,6 +22,7 @@ import static org.mockito.Mockito.mock; import java.net.URL; +import java.nio.file.Path; import org.agrona.DirectBuffer; import org.agrona.concurrent.UnsafeBuffer; @@ -41,13 +42,14 @@ public class FilesystemIT private EngineContext context = mock(EngineContext.class); @Before - public void setup() + public void setup() throws Exception { config = new FilesystemOptionsConfig(singletonList( new FilesystemSchemaConfig("subject1", "asyncapi/mqtt.yaml"))); URL url = FilesystemIT.class.getResource("../../../../specs/catalog/filesystem/config/asyncapi/mqtt.yaml"); - Mockito.doReturn(url).when(context).resolvePath("asyncapi/mqtt.yaml"); + Path path = Path.of(url.toURI()); + Mockito.doReturn(path).when(context).resolvePath("asyncapi/mqtt.yaml"); } @Test diff --git a/incubator/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfigAdapterTest.java b/runtime/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfigAdapterTest.java similarity index 100% rename from incubator/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfigAdapterTest.java rename to runtime/catalog-filesystem/src/test/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/config/FilesystemOptionsConfigAdapterTest.java diff --git a/runtime/catalog-inline/pom.xml b/runtime/catalog-inline/pom.xml index 343c69df4d..a0cb3eb399 100644 --- a/runtime/catalog-inline/pom.xml +++ b/runtime/catalog-inline/pom.xml @@ -1,166 +1,164 @@ - 4.0.0 - - io.aklivity.zilla - runtime - 0.9.82 - ../pom.xml - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + io.aklivity.zilla + runtime + 0.9.83 + ../pom.xml + - catalog-inline - zilla::runtime::catalog-inline +catalog-inline +zilla::runtime::catalog-inline - - - Aklivity Community License Agreement - https://www.aklivity.io/aklivity-community-license/ - repo - - + + + Aklivity Community License Agreement + https://www.aklivity.io/aklivity-community-license/ + repo + + - - 11 - 11 - 0.90 - 0 - + + 0.90 + 0 + - - - ${project.groupId} - catalog-inline.spec - ${project.version} - provided - - - ${project.groupId} - engine - ${project.version} - provided - - - ${project.groupId} - engine - test-jar - ${project.version} - test - - - org.kaazing - k3po.junit - test - + + + ${project.groupId} + catalog-inline.spec + ${project.version} + provided + + + ${project.groupId} + engine + ${project.version} + provided + + + ${project.groupId} + engine + test-jar + ${project.version} + test + + + io.aklivity.k3po + control-junit + test + + + io.aklivity.k3po + lang + test + + + org.mockito + mockito-core + test + + + + + + + org.jasig.maven + maven-notice-plugin + + + com.mycila + license-maven-plugin + + + maven-checkstyle-plugin + + + maven-dependency-plugin + + + process-resources + + unpack + + + + + ${project.groupId} + catalog-inline.spec + + + ^\Qio/aklivity/zilla/specs/catalog/inline/\E + io/aklivity/zilla/runtime/catalog/inline/internal/ + + + + + io/aklivity/zilla/specs/catalog/inline/schema/inline.schema.patch.json + ${project.build.directory}/classes + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + + org.moditect + moditect-maven-plugin + + + org.apache.maven.plugins + maven-failsafe-plugin + + + org.jacoco + jacoco-maven-plugin + + + + BUNDLE + + + INSTRUCTION + COVEREDRATIO + ${jacoco.coverage.ratio} + + + CLASS + MISSEDCOUNT + ${jacoco.missed.count} + + + + + + + + io.aklivity.k3po + k3po-maven-plugin + - org.kaazing - k3po.lang - test + ${project.groupId} + engine + ${project.version} + test-jar - org.mockito - mockito-core - test + ${project.groupId} + engine + ${project.version} - - - - - - org.jasig.maven - maven-notice-plugin - - - com.mycila - license-maven-plugin - - - maven-checkstyle-plugin - - - maven-dependency-plugin - - - process-resources - - unpack - - - - - ${project.groupId} - catalog-inline.spec - - - ^\Qio/aklivity/zilla/specs/catalog/inline/\E - io/aklivity/zilla/runtime/catalog/inline/internal/ - - - - - io/aklivity/zilla/specs/catalog/inline/schema/inline.schema.patch.json - ${project.build.directory}/classes - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - - org.moditect - moditect-maven-plugin - - - org.apache.maven.plugins - maven-failsafe-plugin - - - org.jacoco - jacoco-maven-plugin - - - - BUNDLE - - - INSTRUCTION - COVEREDRATIO - ${jacoco.coverage.ratio} - - - CLASS - MISSEDCOUNT - ${jacoco.missed.count} - - - - - - - - org.kaazing - k3po-maven-plugin - - - ${project.groupId} - engine - ${project.version} - test-jar - - - ${project.groupId} - engine - ${project.version} - - - - - + + + + diff --git a/runtime/catalog-karapace/pom.xml b/runtime/catalog-karapace/pom.xml index 045ed934bd..3102b23d65 100644 --- a/runtime/catalog-karapace/pom.xml +++ b/runtime/catalog-karapace/pom.xml @@ -6,7 +6,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -22,9 +22,7 @@ - 11 - 11 - 0.95 + 0.92 0 @@ -49,13 +47,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -164,7 +162,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceCatalogHandler.java b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceCatalogHandler.java index da1e437166..fbdd09e8ec 100644 --- a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceCatalogHandler.java +++ b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceCatalogHandler.java @@ -331,7 +331,8 @@ public int encode( } @Override - public int encodePadding() + public int encodePadding( + int length) { return MAX_PADDING_LENGTH; } diff --git a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventContext.java b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventContext.java index 74c78934b8..e6cee3bcd5 100644 --- a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventContext.java +++ b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventContext.java @@ -44,7 +44,7 @@ public class KarapaceEventContext private final int staleSchemaID; private final int unretrievableSchemaId; private final int retrievableSchemaSubjectVersionId; - private final int retrievableSchemaId; + private final int retrievedSchemaId; private final MessageConsumer eventWriter; private final Clock clock; @@ -55,8 +55,8 @@ public KarapaceEventContext( this.unretrievableSchemaSubjectVersionId = context.supplyEventId("catalog.karapace.unretrievable.schema.subject.version"); this.staleSchemaID = context.supplyEventId("catalog.karapace.unretrievable.schema.subject.version.stale.schema"); this.unretrievableSchemaId = context.supplyEventId("catalog.karapace.unretrievable.schema.id"); - this.retrievableSchemaSubjectVersionId = context.supplyEventId("catalog.karapace.retrievable.schema.subject.version"); - this.retrievableSchemaId = context.supplyEventId("catalog.karapace.retrievable.schema.id"); + this.retrievableSchemaSubjectVersionId = context.supplyEventId("catalog.karapace.retrieved.schema.subject.version"); + this.retrievedSchemaId = context.supplyEventId("catalog.karapace.retrieved.schema.id"); this.eventWriter = context.supplyEventWriter(); this.clock = context.clock(); } @@ -140,7 +140,7 @@ public void onRetrievableSchemaSubjectVersion( { KarapaceEventExFW extension = karapaceEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) - .retrievableSchemaSubjectVersion(e -> e + .retrievedSchemaSubjectVersion(e -> e .typeId(RETRIEVED_SCHEMA_SUBJECT_VERSION.value()) .subject(subject) .version(version) @@ -163,14 +163,14 @@ public void onRetrievableSchemaId( { KarapaceEventExFW extension = karapaceEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) - .retrievableSchemaId(e -> e + .retrievedSchemaId(e -> e .typeId(RETRIEVED_SCHEMA_ID.value()) .schemaId(schemaId) ) .build(); EventFW event = eventRW .wrap(eventBuffer, 0, eventBuffer.capacity()) - .id(retrievableSchemaId) + .id(retrievedSchemaId) .timestamp(clock.millis()) .traceId(0L) .namespacedId(catalogId) diff --git a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java index 8c342dd962..2447bcb963 100644 --- a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java +++ b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java @@ -19,8 +19,8 @@ import io.aklivity.zilla.runtime.catalog.karapace.internal.types.StringFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.EventFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceEventExFW; -import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceRetrievableSchemaIdExFW; -import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceRetrievableSchemaSubjectVersionExFW; +import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceRetrievedSchemaIdExFW; +import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceRetrievedSchemaSubjectVersionExFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceUnretrievableSchemaIdExFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceUnretrievableSchemaSubjectVersionExFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceUnretrievableSchemaSubjectVersionStaleSchemaExFW; @@ -29,13 +29,6 @@ public final class KarapaceEventFormatter implements EventFormatterSpi { - private static final String UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION = "UNRETRIEVABLE_SCHEMA %s %s"; - private static final String UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA = - "UNRETRIEVABLE_SCHEMA %s %s, USING_STALE_SCHEMA %d"; - private static final String UNRETRIEVABLE_SCHEMA_ID = "UNRETRIEVABLE_SCHEMA_ID %d"; - private static final String RETRIEVED_SCHEMA_SUBJECT_VERSION = "RETRIEVED_SCHEMA_SUBJECT_VERSION %s %s"; - private static final String RETRIEVED_SCHEMA_ID = "RETRIEVED_SCHEMA_ID %d"; - private final EventFW eventRO = new EventFW(); private final KarapaceEventExFW karapaceEventExRO = new KarapaceEventExFW(); @@ -58,33 +51,44 @@ public String format( case UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION: { KarapaceUnretrievableSchemaSubjectVersionExFW ex = extension.unretrievableSchemaSubjectVersion(); - result = String.format(UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION, asString(ex.subject()), asString(ex.version())); + result = String.format( + "Unable to fetch schema for subject %s with version %s.", + asString(ex.subject()), + asString(ex.version()) + ); break; } case UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA: { KarapaceUnretrievableSchemaSubjectVersionStaleSchemaExFW ex = extension .unretrievableSchemaSubjectVersionStaleSchema(); - result = String.format(UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA, asString(ex.subject()), - asString(ex.version()), ex.schemaId()); + result = String.format( + "Unable to fetch schema for subject %s with version %s; using stale schema with id %d.", + asString(ex.subject()), + asString(ex.version()), + ex.schemaId() + ); break; } case UNRETRIEVABLE_SCHEMA_ID: { KarapaceUnretrievableSchemaIdExFW ex = extension.unretrievableSchemaId(); - result = String.format(UNRETRIEVABLE_SCHEMA_ID, ex.schemaId()); + result = String.format("Unable to fetch schema id %d.", ex.schemaId()); break; } case RETRIEVED_SCHEMA_SUBJECT_VERSION: { - KarapaceRetrievableSchemaSubjectVersionExFW ex = extension.retrievableSchemaSubjectVersion(); - result = String.format(RETRIEVED_SCHEMA_SUBJECT_VERSION, asString(ex.subject()), asString(ex.version())); + KarapaceRetrievedSchemaSubjectVersionExFW ex = extension.retrievedSchemaSubjectVersion(); + result = String.format("Successfully fetched schema for subject %s with version %s.", + asString(ex.subject()), + asString(ex.version()) + ); break; } case RETRIEVED_SCHEMA_ID: { - KarapaceRetrievableSchemaIdExFW ex = extension.retrievableSchemaId(); - result = String.format(RETRIEVED_SCHEMA_ID, ex.schemaId()); + KarapaceRetrievedSchemaIdExFW ex = extension.retrievedSchemaId(); + result = String.format("Successfully fetched schema id %d.", ex.schemaId()); break; } } diff --git a/runtime/catalog-karapace/src/test/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceIT.java b/runtime/catalog-karapace/src/test/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceIT.java index 5ab4852340..359a06a3ce 100644 --- a/runtime/catalog-karapace/src/test/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceIT.java +++ b/runtime/catalog-karapace/src/test/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceIT.java @@ -29,9 +29,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.catalog.karapace.internal.config.KarapaceOptionsConfig; import io.aklivity.zilla.runtime.engine.EngineContext; import io.aklivity.zilla.runtime.engine.catalog.CatalogHandler; @@ -164,7 +164,7 @@ public void shouldVerifyMaxPadding() { KarapaceCatalogHandler catalog = new KarapaceCatalogHandler(config, context, 0L); - assertEquals(5, catalog.encodePadding()); + assertEquals(5, catalog.encodePadding(0)); } @Test diff --git a/runtime/command-metrics/pom.xml b/runtime/command-metrics/pom.xml index 20be048775..e6a8fe6d1b 100644 --- a/runtime/command-metrics/pom.xml +++ b/runtime/command-metrics/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.50 2 diff --git a/runtime/command-start/pom.xml b/runtime/command-start/pom.xml index af2a8c1e59..bd82dbff91 100644 --- a/runtime/command-start/pom.xml +++ b/runtime/command-start/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 1.00 0 diff --git a/runtime/command-start/src/main/java/io/aklivity/zilla/runtime/command/start/internal/airline/ZillaStartCommand.java b/runtime/command-start/src/main/java/io/aklivity/zilla/runtime/command/start/internal/airline/ZillaStartCommand.java index cc983dbb43..e72804d72a 100644 --- a/runtime/command-start/src/main/java/io/aklivity/zilla/runtime/command/start/internal/airline/ZillaStartCommand.java +++ b/runtime/command-start/src/main/java/io/aklivity/zilla/runtime/command/start/internal/airline/ZillaStartCommand.java @@ -25,7 +25,6 @@ import java.io.IOException; import java.net.URI; -import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -127,11 +126,9 @@ public void run() EngineConfiguration config = new EngineConfiguration(props); - URL configURL = config.configURL(); - if ("file".equals(configURL.getProtocol())) + Path configPath = Path.of(config.configURI()); + if ("file".equals(configPath.getFileSystem().provider().getScheme())) { - final Path configPath = Paths.get(configURL.getPath()); - if (configPath.endsWith("zilla.yaml") && Files.notExists(configPath)) { Path configJson = configPath.resolveSibling("zilla.json"); diff --git a/runtime/command-stop/pom.xml b/runtime/command-stop/pom.xml index 6a9f537973..4002fdd110 100644 --- a/runtime/command-stop/pom.xml +++ b/runtime/command-stop/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 1.00 0 diff --git a/runtime/command/pom.xml b/runtime/command/pom.xml index 357fab1d10..79b70c4ded 100644 --- a/runtime/command/pom.xml +++ b/runtime/command/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 1.00 0 diff --git a/runtime/common/pom.xml b/runtime/common/pom.xml index 53108913bb..9115effb55 100644 --- a/runtime/common/pom.xml +++ b/runtime/common/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 1.00 0 diff --git a/runtime/common/src/main/java/io/aklivity/zilla/runtime/common/feature/FeatureFilter.java b/runtime/common/src/main/java/io/aklivity/zilla/runtime/common/feature/FeatureFilter.java index 1597cab107..9a00bb8834 100644 --- a/runtime/common/src/main/java/io/aklivity/zilla/runtime/common/feature/FeatureFilter.java +++ b/runtime/common/src/main/java/io/aklivity/zilla/runtime/common/feature/FeatureFilter.java @@ -41,6 +41,13 @@ private static boolean featureEnabled( !feature.getClass().isAnnotationPresent(Incubating.class); } + public static boolean featureEnabled( + Class feature) + { + return INCUBATOR_ENABLED || + !feature.isAnnotationPresent(Incubating.class); + } + private static boolean incubatorEnabled() { final Module module = FeatureFilter.class.getModule(); diff --git a/runtime/engine/pom.xml b/runtime/engine/pom.xml index e8a38a147d..06772cfdd6 100644 --- a/runtime/engine/pom.xml +++ b/runtime/engine/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,9 +24,7 @@ - 11 - 11 - 0.77 + 0.74 5 @@ -79,6 +77,31 @@ jackson-dataformat-yaml 2.16.1 + + ${project.groupId} + filesystem-http + test + + + org.jboss.byteman + byteman + test + + + org.jboss.byteman + byteman-submit + test + + + org.jboss.byteman + byteman-install + test + + + org.jboss.byteman + byteman-bmunit + test + org.jmock jmock-junit4 @@ -90,18 +113,18 @@ test - org.kaazing - k3po.driver + io.aklivity.k3po + driver test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -228,6 +251,10 @@ org.apache.maven.plugins maven-compiler-plugin + + org.jboss.byteman + byteman-rulecheck-maven-plugin + org.apache.maven.plugins maven-surefire-plugin @@ -274,7 +301,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin @@ -282,6 +309,12 @@ ${project.artifactId} ${project.version} + + ${project.groupId} + ${project.artifactId} + ${project.version} + test-jar + diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/Engine.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/Engine.java index c504dc9531..130d6545c3 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/Engine.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/Engine.java @@ -16,21 +16,12 @@ package io.aklivity.zilla.runtime.engine; import static io.aklivity.zilla.runtime.engine.internal.layouts.metrics.HistogramsLayout.BUCKETS; -import static java.net.http.HttpClient.Redirect.NORMAL; -import static java.net.http.HttpClient.Version.HTTP_2; -import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.concurrent.Executors.newFixedThreadPool; import static java.util.stream.Collectors.toList; import static org.agrona.LangUtil.rethrowUnchecked; -import java.io.IOException; -import java.io.InputStream; -import java.net.URISyntaxException; import java.net.URL; -import java.net.URLConnection; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; +import java.time.Clock; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -40,11 +31,9 @@ import java.util.ServiceLoader.Provider; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.concurrent.Future; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; -import java.util.function.Function; import java.util.function.IntFunction; import java.util.function.LongConsumer; import java.util.function.LongSupplier; @@ -68,12 +57,10 @@ import io.aklivity.zilla.runtime.engine.internal.Info; import io.aklivity.zilla.runtime.engine.internal.LabelManager; import io.aklivity.zilla.runtime.engine.internal.Tuning; +import io.aklivity.zilla.runtime.engine.internal.event.EngineEventContext; import io.aklivity.zilla.runtime.engine.internal.layouts.EventsLayout; import io.aklivity.zilla.runtime.engine.internal.registry.EngineManager; import io.aklivity.zilla.runtime.engine.internal.registry.EngineWorker; -import io.aklivity.zilla.runtime.engine.internal.registry.FileWatcherTask; -import io.aklivity.zilla.runtime.engine.internal.registry.HttpWatcherTask; -import io.aklivity.zilla.runtime.engine.internal.registry.WatcherTask; import io.aklivity.zilla.runtime.engine.internal.types.event.EventFW; import io.aklivity.zilla.runtime.engine.metrics.Collector; import io.aklivity.zilla.runtime.engine.metrics.MetricGroup; @@ -83,6 +70,8 @@ public final class Engine implements Collector, AutoCloseable { + public static final String NAME = "engine"; + private final Collection bindings; private final ExecutorService tasks; private final Tuning tuning; @@ -92,14 +81,12 @@ public final class Engine implements Collector, AutoCloseable private final AtomicInteger nextTaskId; private final ThreadFactory factory; - private final WatcherTask watcherTask; - private final URL configURL; private final List workers; private final boolean readonly; private final EngineConfiguration config; private final EngineManager manager; - private Future watcherTaskRef; + private final EventsLayout eventsLayout; Engine( EngineConfiguration config, @@ -160,6 +147,11 @@ public final class Engine implements Collector, AutoCloseable } this.tuning = tuning; + this.eventsLayout = new EventsLayout.Builder() + .path(config.directory().resolve("events")) + .capacity(config.eventsBufferCapacity()) + .build(); + List workers = new ArrayList<>(workerCount); for (int workerIndex = 0; workerIndex < workerCount; workerIndex++) { @@ -193,6 +185,8 @@ public final class Engine implements Collector, AutoCloseable final Map guardsByType = guards.stream() .collect(Collectors.toMap(g -> g.name(), g -> g)); + EngineEventContext events = new EngineEventContext(this); + EngineManager manager = new EngineManager( schemaTypes, bindingsByType::get, @@ -205,24 +199,8 @@ public final class Engine implements Collector, AutoCloseable logger, context, config, - extensions, - this::readURL); - - this.configURL = config.configURL(); - String protocol = configURL.getProtocol(); - if ("file".equals(protocol) || "jar".equals(protocol)) - { - Function watcherReadURL = l -> readURL(configURL, l); - this.watcherTask = new FileWatcherTask(manager::reconfigure, watcherReadURL); - } - else if ("http".equals(protocol) || "https".equals(protocol)) - { - this.watcherTask = new HttpWatcherTask(manager::reconfigure, config.configPollIntervalSeconds()); - } - else - { - throw new UnsupportedOperationException(); - } + events, + extensions); this.bindings = bindings; this.tasks = tasks; @@ -255,11 +233,10 @@ public void start() throws Exception worker.doStart(); } - watcherTaskRef = watcherTask.submit(); + // ignore the config file in read-only mode; no config will be read so no namespaces, bindings, etc. will be attached if (!readonly) { - // ignore the config file in read-only mode; no config will be read so no namespaces, bindings, etc will be attached - watcherTask.watch(configURL).get(); + manager.start(); } } @@ -273,8 +250,7 @@ public void close() throws Exception final List errors = new ArrayList<>(); - watcherTask.close(); - watcherTaskRef.get(); + manager.close(); for (EngineWorker worker : workers) { @@ -311,52 +287,24 @@ public ContextImpl context() return context; } - public static EngineBuilder builder() + public EventsLayout.EventAccessor createEventAccessor() { - return new EngineBuilder(); + return eventsLayout.createEventAccessor(); } - private String readURL( - URL configURL, - String location) + public MessageConsumer supplyEventWriter() { - String output = null; - try - { - final URL fileURL = new URL(configURL, location); - if ("http".equals(fileURL.getProtocol()) || "https".equals(fileURL.getProtocol())) - { - HttpClient client = HttpClient.newBuilder() - .version(HTTP_2) - .followRedirects(NORMAL) - .build(); - - HttpRequest request = HttpRequest.newBuilder() - .GET() - .uri(fileURL.toURI()) - .build(); - - HttpResponse response = client.send( - request, - HttpResponse.BodyHandlers.ofString()); + return this.eventsLayout::writeEvent; + } - output = response.body(); - } - else - { + public Clock clock() + { + return Clock.systemUTC(); + } - URLConnection connection = fileURL.openConnection(); - try (InputStream input = connection.getInputStream()) - { - output = new String(input.readAllBytes(), UTF_8); - } - } - } - catch (IOException | URISyntaxException | InterruptedException ex) - { - output = ""; - } - return output; + public static EngineBuilder builder() + { + return new EngineBuilder(); } private Thread newTaskThread( @@ -522,20 +470,30 @@ public int supplyLabelId( return worker.supplyTypeId(label); } + public long supplyNamespacedId( + String namespace, + String name) + { + final int namespaceId = supplyLabelId(namespace); + final int bindingId = supplyLabelId(name); + return NamespacedId.id(namespaceId, bindingId); + } + private final class EventReader implements MessageReader { private final EventsLayout.EventAccessor[] accessors; private final EventFW eventRO = new EventFW(); - private int minWorkerIndex; + private int minAccessorIndex; private long minTimeStamp; EventReader() { - accessors = new EventsLayout.EventAccessor[workers.size()]; + accessors = new EventsLayout.EventAccessor[workers.size() + 1]; for (int i = 0; i < workers.size(); i++) { accessors[i] = workers.get(i).createEventAccessor(); } + accessors[workers.size()] = createEventAccessor(); } @Override @@ -548,18 +506,18 @@ public int read( while (!empty && messagesRead < messageCountLimit) { int eventCount = 0; - minWorkerIndex = 0; + minAccessorIndex = 0; minTimeStamp = Long.MAX_VALUE; - for (int j = 0; j < workers.size(); j++) + for (int j = 0; j < accessors.length; j++) { - final int workerIndex = j; - int eventPeeked = accessors[workerIndex].peekEvent((m, b, i, l) -> + final int accessorIndex = j; + int eventPeeked = accessors[accessorIndex].peekEvent((m, b, i, l) -> { eventRO.wrap(b, i, i + l); if (eventRO.timestamp() < minTimeStamp) { minTimeStamp = eventRO.timestamp(); - minWorkerIndex = workerIndex; + minAccessorIndex = accessorIndex; } }); eventCount += eventPeeked; @@ -567,7 +525,7 @@ public int read( empty = eventCount == 0; if (!empty) { - messagesRead += accessors[minWorkerIndex].readEvent(handler, 1); + messagesRead += accessors[minAccessorIndex].readEvent(handler, 1); } } return messagesRead; diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineConfiguration.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineConfiguration.java index 5f9522446d..c843495e29 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineConfiguration.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineConfiguration.java @@ -19,6 +19,7 @@ import static java.util.concurrent.TimeUnit.NANOSECONDS; import static java.util.concurrent.TimeUnit.SECONDS; +import java.io.File; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; @@ -44,6 +45,8 @@ public class EngineConfiguration extends Configuration public static final boolean DEBUG_BUDGETS = Boolean.getBoolean("zilla.engine.debug.budgets"); public static final PropertyDef ENGINE_CONFIG_URL; + public static final PropertyDef ENGINE_CONFIG_URI; + public static final BooleanPropertyDef ENGINE_CONFIG_WATCH; public static final IntPropertyDef ENGINE_CONFIG_POLL_INTERVAL_SECONDS; public static final PropertyDef ENGINE_NAME; public static final PropertyDef ENGINE_DIRECTORY; @@ -81,6 +84,9 @@ public class EngineConfiguration extends Configuration { final ConfigurationDef config = new ConfigurationDef("zilla.engine"); ENGINE_CONFIG_URL = config.property(URL.class, "config.url", EngineConfiguration::configURL, "file:zilla.yaml"); + ENGINE_CONFIG_URI = config.property(URI.class, "config.uri", EngineConfiguration::decodeConfigURI, + EngineConfiguration::defaultConfigURI); + ENGINE_CONFIG_WATCH = config.property("config.watch", true); ENGINE_CONFIG_POLL_INTERVAL_SECONDS = config.property("config.poll.interval.seconds", 60); ENGINE_NAME = config.property("name", EngineConfiguration::defaultName); ENGINE_DIRECTORY = config.property("directory", EngineConfiguration::defaultDirectory); @@ -141,11 +147,22 @@ public EngineConfiguration() super(ENGINE_CONFIG, new Configuration()); } + @Deprecated public URL configURL() { return ENGINE_CONFIG_URL.get(this); } + public URI configURI() + { + return ENGINE_CONFIG_URI.get(this); + } + + public boolean configWatch() + { + return ENGINE_CONFIG_WATCH.get(this); + } + public int configPollIntervalSeconds() { return ENGINE_CONFIG_POLL_INTERVAL_SECONDS.getAsInt(this); @@ -314,8 +331,7 @@ private static int defaultBudgetsBufferCapacity( private static URL configURL( Configuration config, - String url - ) + String url) { URL configURL = null; try @@ -416,4 +432,20 @@ private static HostResolver defaultHostResolver( return addresses; }; } + + private static URI decodeConfigURI( + Configuration config, + String value) + { + return value.startsWith("file:") + ? new File(value.substring("file:".length())).toURI() + : URI.create(value); + } + + private static URI defaultConfigURI( + Configuration config) + { + URL url = ENGINE_CONFIG_URL.get(config); + return decodeConfigURI(config, url.toString()); + } } diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineContext.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineContext.java index 15628a3b60..c810d29998 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineContext.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineContext.java @@ -16,8 +16,8 @@ package io.aklivity.zilla.runtime.engine; import java.net.InetAddress; -import java.net.URL; import java.nio.channels.SelectableChannel; +import java.nio.file.Path; import java.time.Clock; import java.util.function.LongSupplier; @@ -134,6 +134,9 @@ String supplyQName( int supplyEventId( String name); + String supplyEventName( + int eventId); + BindingHandler streamFactory(); GuardHandler supplyGuard( @@ -154,8 +157,8 @@ ConverterHandler supplyReadConverter( ConverterHandler supplyWriteConverter( ModelConfig config); - URL resolvePath( - String path); + Path resolvePath( + String location); Metric resolveMetric( String name); diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/catalog/CatalogHandler.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/catalog/CatalogHandler.java index 9460c48872..d6b730e261 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/catalog/CatalogHandler.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/catalog/CatalogHandler.java @@ -101,7 +101,16 @@ default int encode( return encoder.accept(traceId, bindingId, schemaId, data, index, length, next); } - default int encodePadding() + default int encodePadding( + int length) + { + return 0; + } + + default int decodePadding( + DirectBuffer data, + int index, + int length) { return 0; } diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/BindingConfig.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/BindingConfig.java index 33faaec460..0eb2852e64 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/BindingConfig.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/BindingConfig.java @@ -27,7 +27,6 @@ public class BindingConfig public transient long id; public transient long entryId; public transient ToLongFunction resolveId; - public transient Function readURL; public transient long vaultId; public transient String qvault; diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/ConfigAdapterContext.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/ConfigAdapterContext.java index fa4f5161e9..bddd2c77f5 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/ConfigAdapterContext.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/ConfigAdapterContext.java @@ -15,7 +15,9 @@ */ package io.aklivity.zilla.runtime.engine.config; +@Deprecated public interface ConfigAdapterContext { - String readURL(String location); + String readResource( + String location); } diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/EngineConfigBuilder.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/EngineConfigBuilder.java index 5c4f01df83..914ff3ca76 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/EngineConfigBuilder.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/EngineConfigBuilder.java @@ -68,7 +68,6 @@ public T build() namespaces = new LinkedList<>(); } - return mapper.apply(new EngineConfig( - namespaces)); + return mapper.apply(new EngineConfig(namespaces)); } } diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/EngineConfigReader.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/EngineConfigReader.java index 5b1aa71d27..b2be03ac84 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/EngineConfigReader.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/EngineConfigReader.java @@ -60,7 +60,6 @@ public final class EngineConfigReader private final Collection schemaTypes; private final Consumer logger; - public EngineConfigReader( EngineConfiguration config, ConfigAdapterContext context, @@ -161,7 +160,8 @@ public EngineConfig read( { reader.reset(); reader.skip(configAt); - builder.namespace(jsonb.fromJson(reader, NamespaceConfig.class)); + NamespaceConfig namespace = jsonb.fromJson(reader, NamespaceConfig.class); + builder.namespace(namespace); if (!errors.isEmpty()) { diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/GuardConfig.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/GuardConfig.java index 5804edd815..5363211bfd 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/GuardConfig.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/GuardConfig.java @@ -18,12 +18,9 @@ import static java.util.Objects.requireNonNull; import static java.util.function.Function.identity; -import java.util.function.Function; - public class GuardConfig { public transient long id; - public transient Function readURL; public final String namespace; public final String name; diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/NamespaceConfig.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/NamespaceConfig.java index a98f862482..16e6fe30f8 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/NamespaceConfig.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/NamespaceConfig.java @@ -18,13 +18,14 @@ import static java.util.Objects.requireNonNull; import static java.util.function.Function.identity; +import java.util.LinkedList; import java.util.List; -import java.util.function.Function; public class NamespaceConfig { + public static final String FILESYSTEM = "filesystem"; + public transient int id; - public transient Function readURL; public final String name; public final TelemetryConfig telemetry; @@ -32,6 +33,7 @@ public class NamespaceConfig public final List guards; public final List vaults; public final List catalogs; + public final List resources; public static NamespaceConfigBuilder builder() { @@ -52,5 +54,52 @@ public static NamespaceConfigBuilder builder() this.guards = requireNonNull(guards); this.vaults = requireNonNull(vaults); this.catalogs = requireNonNull(catalogs); + this.resources = resolveResources(this, telemetry, bindings, guards, vaults, catalogs); + } + + private static List resolveResources( + NamespaceConfig namespace, + TelemetryConfig telemetry, + List bindings, + List guards, + List vaults, + List catalogs) + { + List options = new LinkedList<>(); + + if (telemetry != null && telemetry.exporters != null) + { + telemetry.exporters.stream() + .filter(e -> e.options != null) + .map(e -> e.options) + .forEach(options::add); + } + + bindings.stream() + .filter(b -> b.options != null) + .map(b -> b.options) + .forEach(options::add); + + guards.stream() + .filter(g -> g.options != null) + .map(g -> g.options) + .forEach(options::add); + + vaults.stream() + .filter(v -> v.options != null) + .map(v -> v.options) + .forEach(options::add); + + catalogs.stream() + .filter(c -> c.options != null) + .map(c -> c.options) + .forEach(options::add); + + return options.stream() + .filter(o -> o.resources != null) + .flatMap(o -> o.resources.stream()) + .sorted() + .distinct() + .toList(); } } diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/OptionsConfig.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/OptionsConfig.java index 2e83dcc8f6..7eba0cd095 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/OptionsConfig.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/config/OptionsConfig.java @@ -21,15 +21,18 @@ public class OptionsConfig { public final List models; + public final List resources; public OptionsConfig() { - this(Collections.emptyList()); + this(Collections.emptyList(), Collections.emptyList()); } public OptionsConfig( - List models) + List models, + List resources) { this.models = models; + this.resources = resources; } } diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/event/EngineEventContext.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/event/EngineEventContext.java new file mode 100644 index 0000000000..870fc53e7b --- /dev/null +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/event/EngineEventContext.java @@ -0,0 +1,81 @@ +/* + * Copyright 2021-2023 Aklivity Inc. + * + * Aklivity licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.aklivity.zilla.runtime.engine.internal.event; + +import static io.aklivity.zilla.runtime.engine.internal.types.event.EngineEventType.CONFIG_WATCHER_FAILED; + +import java.nio.ByteBuffer; +import java.time.Clock; + +import org.agrona.MutableDirectBuffer; +import org.agrona.concurrent.UnsafeBuffer; + +import io.aklivity.zilla.runtime.engine.Engine; +import io.aklivity.zilla.runtime.engine.binding.function.MessageConsumer; +import io.aklivity.zilla.runtime.engine.internal.types.event.EngineEventExFW; +import io.aklivity.zilla.runtime.engine.internal.types.event.EventFW; + +public final class EngineEventContext +{ + private static final int EVENT_BUFFER_CAPACITY = 1024; + + private final MutableDirectBuffer eventBuffer = new UnsafeBuffer(ByteBuffer.allocate(EVENT_BUFFER_CAPACITY)); + private final MutableDirectBuffer extensionBuffer = new UnsafeBuffer(ByteBuffer.allocate(EVENT_BUFFER_CAPACITY)); + + private final EventFW.Builder eventRW = new EventFW.Builder(); + private final EngineEventExFW.Builder eventExRW = new EngineEventExFW.Builder(); + + private final long engineId; + private final int engineTypeId; + private final int configWatcherFailedEventId; + private final MessageConsumer eventWriter; + private final Clock clock; + + public EngineEventContext( + Engine engine) + { + this.engineId = engine.supplyNamespacedId(Engine.NAME, "events"); + this.engineTypeId = engine.supplyLabelId(Engine.NAME); + this.configWatcherFailedEventId = engine.supplyLabelId("engine.config.watcher.failed"); + this.eventWriter = engine.supplyEventWriter(); + this.clock = engine.clock(); + } + + public void configWatcherFailed( + long traceId, + String reason) + { + EngineEventExFW extension = eventExRW + .wrap(extensionBuffer, 0, extensionBuffer.capacity()) + .configWatcherFailed(e -> e + .typeId(CONFIG_WATCHER_FAILED.value()) + .reason(reason) + ) + .build(); + + EventFW event = eventRW + .wrap(eventBuffer, 0, eventBuffer.capacity()) + .id(configWatcherFailedEventId) + .timestamp(clock.millis()) + .traceId(traceId) + .namespacedId(engineId) + .extension(extension.buffer(), extension.offset(), extension.limit()) + .build(); + + eventWriter.accept(engineTypeId, event.buffer(), event.offset(), event.limit()); + } + +} diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/event/EngineEventFormatter.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/event/EngineEventFormatter.java new file mode 100644 index 0000000000..54297ccf62 --- /dev/null +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/event/EngineEventFormatter.java @@ -0,0 +1,65 @@ +/* + * Copyright 2021-2023 Aklivity Inc. + * + * Aklivity licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.aklivity.zilla.runtime.engine.internal.event; + +import org.agrona.DirectBuffer; + +import io.aklivity.zilla.runtime.engine.Configuration; +import io.aklivity.zilla.runtime.engine.event.EventFormatterSpi; +import io.aklivity.zilla.runtime.engine.internal.types.event.EngineConfigWatcherFailedExFW; +import io.aklivity.zilla.runtime.engine.internal.types.event.EngineEventExFW; +import io.aklivity.zilla.runtime.engine.internal.types.event.EventFW; + +public final class EngineEventFormatter implements EventFormatterSpi +{ + private static final String CONFIG_WATCHER_FAILED_FORMAT = + "Dynamic config reloading is disabled."; + private static final String CONFIG_WATCHER_FAILED_WITH_REASON_FORMAT = + CONFIG_WATCHER_FAILED_FORMAT + " %s."; + + private final EventFW eventRO = new EventFW(); + private final EngineEventExFW eventExRO = new EngineEventExFW(); + + EngineEventFormatter( + Configuration config) + { + } + + public String format( + DirectBuffer buffer, + int index, + int length) + { + final EventFW event = eventRO.wrap(buffer, index, index + length); + final EngineEventExFW extension = eventExRO + .wrap(event.extension().buffer(), event.extension().offset(), event.extension().limit()); + + String text = null; + switch (extension.kind()) + { + case CONFIG_WATCHER_FAILED: + EngineConfigWatcherFailedExFW configWatcherFailed = extension.configWatcherFailed(); + String reason = configWatcherFailed.reason().asString(); + String format = reason != null + ? CONFIG_WATCHER_FAILED_WITH_REASON_FORMAT + : CONFIG_WATCHER_FAILED_FORMAT; + text = String.format(format, reason); + break; + } + + return text; + } +} diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/event/EngineEventFormatterFactory.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/event/EngineEventFormatterFactory.java new file mode 100644 index 0000000000..f07a164c9b --- /dev/null +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/event/EngineEventFormatterFactory.java @@ -0,0 +1,36 @@ +/* + * Copyright 2021-2023 Aklivity Inc. + * + * Aklivity licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.aklivity.zilla.runtime.engine.internal.event; + +import io.aklivity.zilla.runtime.engine.Configuration; +import io.aklivity.zilla.runtime.engine.Engine; +import io.aklivity.zilla.runtime.engine.event.EventFormatterFactorySpi; + +public final class EngineEventFormatterFactory implements EventFormatterFactorySpi +{ + @Override + public EngineEventFormatter create( + Configuration config) + { + return new EngineEventFormatter(config); + } + + @Override + public String type() + { + return Engine.NAME; + } +} diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineManager.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineManager.java index 4d8da63eff..b56c247b71 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineManager.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineManager.java @@ -18,14 +18,17 @@ import static java.util.stream.Collectors.toList; import static org.agrona.LangUtil.rethrowUnchecked; +import java.io.IOException; import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.List; +import java.util.Objects; import java.util.Set; import java.util.concurrent.CompletableFuture; -import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.IntFunction; @@ -62,6 +65,8 @@ import io.aklivity.zilla.runtime.engine.guard.Guard; import io.aklivity.zilla.runtime.engine.internal.Tuning; import io.aklivity.zilla.runtime.engine.internal.config.NamespaceAdapter; +import io.aklivity.zilla.runtime.engine.internal.event.EngineEventContext; +import io.aklivity.zilla.runtime.engine.internal.watcher.EngineConfigWatchTask; import io.aklivity.zilla.runtime.engine.namespace.NamespacedId; import io.aklivity.zilla.runtime.engine.resolver.Resolver; @@ -81,9 +86,11 @@ public class EngineManager private final EngineExtContext context; private final EngineConfiguration config; private final List extensions; - private final BiFunction readURL; private final Resolver expressions; + private final Path configPath; + private final EngineConfigWatchTask watchTask; + private String currentText; private EngineConfig current; public EngineManager( @@ -98,8 +105,8 @@ public EngineManager( Consumer logger, EngineExtContext context, EngineConfiguration config, - List extensions, - BiFunction readURL) + EngineEventContext events, + List extensions) { this.schemaTypes = schemaTypes; this.bindingByType = bindingByType; @@ -113,34 +120,73 @@ public EngineManager( this.context = context; this.config = config; this.extensions = extensions; - this.readURL = readURL; this.expressions = Resolver.instantiate(config); + this.configPath = Path.of(config.configURI()); + this.watchTask = new WatchTaskImpl(config, events, configPath); } - public EngineConfig reconfigure( - URL configURL, - String configText) + public void start() throws Exception + { + watchTask.submit(); + } + + public void close() + { + watchTask.close(); + } + + public void process( + NamespaceConfig namespace) + { + final List guards = current.namespaces.stream() + .map(n -> n.guards) + .flatMap(gs -> gs.stream()) + .collect(toList()); + + process(guards, namespace); + } + + private void onPathChanged( + Path watchedPath) { EngineConfig newConfig = null; + reconfigure: try { - newConfig = parse(configURL, configText); + if (!Files.exists(watchedPath)) + { + break reconfigure; + } + + String newConfigText = Files.readString(configPath); + if (Objects.equals(currentText, newConfigText)) + { + break reconfigure; + } + + newConfig = parse(newConfigText); if (newConfig != null) { + final String oldConfigText = currentText; final EngineConfig oldConfig = current; + unregister(oldConfig); try { + currentText = newConfigText; current = newConfig; + register(newConfig); } catch (Exception ex) { context.onError(ex); + currentText = oldConfigText; current = oldConfig; + register(oldConfig); rethrowUnchecked(ex); @@ -159,23 +205,9 @@ public EngineConfig reconfigure( throw new ConfigException("Engine configuration failed", ex); } } - - return newConfig; - } - - public void process( - NamespaceConfig namespace) - { - final List guards = current.namespaces.stream() - .map(n -> n.guards) - .flatMap(gs -> gs.stream()) - .collect(toList()); - - process(guards, namespace); } private EngineConfig parse( - URL configURL, String configText) { EngineConfig engine = null; @@ -189,11 +221,9 @@ private EngineConfig parse( try { - final Function namespaceReadURL = l -> readURL.apply(configURL, l); - EngineConfigReader reader = new EngineConfigReader( config, - new NamespaceConfigAdapterContext(namespaceReadURL), + new NamespaceConfigAdapterContext(Path.of(config.configURI())), expressions, schemaTypes, logger); @@ -207,7 +237,6 @@ private EngineConfig parse( for (NamespaceConfig namespace : engine.namespaces) { - namespace.readURL = l -> readURL.apply(configURL, l); process(guards, namespace); } } @@ -223,8 +252,6 @@ private void process( List guards, NamespaceConfig namespace) { - assert namespace.readURL != null; - namespace.id = supplyId.applyAsInt(namespace.name); NameResolver resolver = new NameResolver(namespace.id); @@ -232,7 +259,6 @@ private void process( for (GuardConfig guard : namespace.guards) { guard.id = resolver.resolve(guard.name); - guard.readURL = namespace.readURL; } for (VaultConfig vault : namespace.vaults) @@ -264,7 +290,6 @@ private void process( binding.id = resolver.resolve(binding.name); binding.entryId = resolver.resolve(binding.entry); binding.resolveId = resolver::resolve; - binding.readURL = namespace.readURL; binding.typeId = supplyId.applyAsInt(binding.type); binding.kindId = supplyId.applyAsInt(binding.kind.name().toLowerCase()); @@ -377,6 +402,7 @@ private void register( for (NamespaceConfig namespace : config.namespaces) { register(namespace); + watch(namespace); } } @@ -390,6 +416,7 @@ private void unregister( { for (NamespaceConfig namespace : config.namespaces) { + unwatch(namespace); unregister(namespace); } } @@ -397,6 +424,20 @@ private void unregister( extensions.forEach(e -> e.onUnregistered(context)); } + private void watch( + NamespaceConfig namespace) + { + namespace.resources.stream() + .forEach(watchTask::watch); + } + + private void unwatch( + NamespaceConfig namespace) + { + namespace.resources.stream() + .forEach(watchTask::unwatch); + } + private void register( NamespaceConfig namespace) { @@ -421,20 +462,20 @@ private void unregister( private final class NameResolver { private final int namespaceId; - private final Matcher matchName; + private final ThreadLocal matchName; private NameResolver( int namespaceId) { this.namespaceId = namespaceId; - this.matchName = NamespaceAdapter.PATTERN_NAME.matcher(""); + this.matchName = ThreadLocal.withInitial(() -> NamespaceAdapter.PATTERN_NAME.matcher("")); } private long resolve( String name) { long id = 0L; - + Matcher matchName = this.matchName.get(); if (name != null && matchName.reset(name).matches()) { String ns = matchName.group("namespace"); @@ -445,7 +486,6 @@ private long resolve( id = NamespacedId.id(nsid, nid); } - return id; } @@ -460,19 +500,49 @@ private String format( private static final class NamespaceConfigAdapterContext implements ConfigAdapterContext { - private final Function readURL; + private final Path configPath; NamespaceConfigAdapterContext( - Function readURL) + Path configPath) { - this.readURL = readURL; + this.configPath = configPath; } @Override - public String readURL( + public String readResource( String location) { - return readURL.apply(location); + String content = null; + + try + { + Path path = configPath.resolveSibling(location); + content = Files.readString(path); + } + catch (IOException ex) + { + rethrowUnchecked(ex); + } + + return content; + } + } + + private final class WatchTaskImpl extends EngineConfigWatchTask + { + WatchTaskImpl( + EngineConfiguration config, + EngineEventContext events, + Path configPath) + { + super(config, events, configPath); + } + + @Override + protected void onPathChanged( + Path watchedPath) + { + EngineManager.this.onPathChanged(watchedPath); } } } diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineWorker.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineWorker.java index 0d535e2d8a..c74bd9cd33 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineWorker.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineWorker.java @@ -37,13 +37,11 @@ import static java.lang.ThreadLocal.withInitial; import static java.util.concurrent.TimeUnit.MILLISECONDS; import static org.agrona.CloseHelper.quietClose; -import static org.agrona.LangUtil.rethrowUnchecked; import static org.agrona.concurrent.AgentRunner.startOnThread; import java.net.InetAddress; -import java.net.MalformedURLException; -import java.net.URL; import java.nio.channels.SelectableChannel; +import java.nio.file.Path; import java.time.Clock; import java.time.Duration; import java.util.BitSet; @@ -173,7 +171,6 @@ public class EngineWorker implements EngineContext, Agent private final int localIndex; private final EngineConfiguration config; - private final URL configURL; private final LabelManager labels; private final String agentName; private final Function resolveHost; @@ -209,7 +206,7 @@ public class EngineWorker implements EngineContext, Agent private final DeadlineTimerWheel timerWheel; private final Long2ObjectHashMap tasksByTimerId; private final Long2ObjectHashMap> futuresById; - private final ElektronSignaler signaler; + private final EngineSignaler signaler; private final Long2ObjectHashMap correlations; private final Long2ObjectHashMap exportersById; private final Map modelsByType; @@ -217,6 +214,7 @@ public class EngineWorker implements EngineContext, Agent private final EngineRegistry registry; private final Deque taskQueue; private final LongUnaryOperator affinityMask; + private final Path configPath; private final AgentRunner runner; private final IdleStrategy idleStrategy; private final ErrorHandler errorHandler; @@ -224,6 +222,7 @@ public class EngineWorker implements EngineContext, Agent private final ScalarsLayout gaugesLayout; private final HistogramsLayout histogramsLayout; private final EventsLayout eventsLayout; + private final Int2ObjectHashMap eventNames; private final Supplier supplyEventReader; private final EventFormatterFactory eventFormatterFactory; @@ -259,7 +258,7 @@ public EngineWorker( { this.localIndex = index; this.config = config; - this.configURL = config.configURL(); + this.configPath = Path.of(config.configURI()); this.labels = labels; this.affinityMask = affinityMask; @@ -308,9 +307,11 @@ public EngineWorker( .build(); this.eventsLayout = new EventsLayout.Builder() - .path(config.directory().resolve(String.format("events%d", index))) - .capacity(config.eventsBufferCapacity()) - .build(); + .path(config.directory().resolve(String.format("events%d", index))) + .capacity(config.eventsBufferCapacity()) + .build(); + + this.eventNames = new Int2ObjectHashMap<>(); this.agentName = String.format("engine/data#%d", index); this.streamsLayout = streamsLayout; @@ -338,7 +339,7 @@ public EngineWorker( this.timerWheel = new DeadlineTimerWheel(MILLISECONDS, currentTimeMillis(), 512, 1024); this.tasksByTimerId = new Long2ObjectHashMap<>(); this.futuresById = new Long2ObjectHashMap<>(); - this.signaler = new ElektronSignaler(executor, Math.max(config.bufferSlotCapacity(), 512)); + this.signaler = new EngineSignaler(executor, Math.max(config.bufferSlotCapacity(), 512)); this.poller = new Poller(); @@ -485,6 +486,13 @@ public int supplyEventId( return labels.supplyLabelId(name); } + @Override + public String supplyEventName( + int eventId) + { + return eventNames.computeIfAbsent(eventId, this::computeEventName); + } + @Override public int supplyTypeId( String name) @@ -732,19 +740,12 @@ public ConverterHandler supplyWriteConverter( } @Override - public URL resolvePath( - String path) + public Path resolvePath( + String location) { - URL resolved = null; - try - { - resolved = new URL(configURL, path); - } - catch (MalformedURLException ex) - { - rethrowUnchecked(ex); - } - return resolved; + return location.indexOf(':') == -1 + ? configPath.resolveSibling(location) + : Path.of(configPath.toUri().resolve(location)); } @Override @@ -1102,7 +1103,11 @@ private void onSystemSignal( switch (signalId) { case SIGNAL_TASK_QUEUED: - taskQueue.poll().run(); + final Runnable task = taskQueue.poll(); + if (task != null) + { + task.run(); + } break; } } @@ -1733,6 +1738,12 @@ public EventFormatter supplyEventFormatter() return eventFormatterFactory.create(config, this); } + private String computeEventName( + int eventId) + { + return supplyLocalName(eventId).replace('.', '_').toUpperCase(); + } + private MessageConsumer supplyWriter( int index) { @@ -1891,7 +1902,7 @@ private Int2ObjectHashMap[] initDispatcher() return dispatcher; } - private final class ElektronSignaler implements Signaler + private final class EngineSignaler implements Signaler { private final ThreadLocal signalRW; @@ -1899,7 +1910,7 @@ private final class ElektronSignaler implements Signaler private long nextFutureId; - private ElektronSignaler( + private EngineSignaler( ExecutorService executorService, int slotCapacity) { diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/FileWatcherTask.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/FileWatcherTask.java deleted file mode 100644 index fbcc466fb5..0000000000 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/FileWatcherTask.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright 2021-2023 Aklivity Inc. - * - * Aklivity licenses this file to you under the Apache License, - * version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -package io.aklivity.zilla.runtime.engine.internal.registry; - -import static org.agrona.LangUtil.rethrowUnchecked; - -import java.io.IOException; -import java.net.URL; -import java.nio.file.ClosedWatchServiceException; -import java.nio.file.FileSystems; -import java.nio.file.WatchKey; -import java.nio.file.WatchService; -import java.util.IdentityHashMap; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Future; -import java.util.function.BiFunction; -import java.util.function.Function; - -import io.aklivity.zilla.runtime.engine.config.EngineConfig; - -public class FileWatcherTask extends WatcherTask -{ - private final Map watchedConfigs; - private final WatchService watchService; - private final Function readURL; - - public FileWatcherTask( - BiFunction changeListener, - Function readURL) - { - super(changeListener); - this.readURL = readURL; - this.watchedConfigs = new IdentityHashMap<>(); - WatchService watchService = null; - - try - { - watchService = FileSystems.getDefault().newWatchService(); - } - catch (IOException ex) - { - rethrowUnchecked(ex); - } - - this.watchService = watchService; - - } - - @Override - public Future submit() - { - return executor.submit(this); - } - - @Override - public Void call() - { - while (true) - { - try - { - final WatchKey key = watchService.take(); - - WatchedConfig watchedConfig = watchedConfigs.get(key); - - if (watchedConfig != null && watchedConfig.isWatchedKey(key)) - { - // Even if no reconfigure needed, recalculation is necessary, since symlinks might have changed. - watchedConfig.keys().forEach(watchedConfigs::remove); - watchedConfig.unregister(); - watchedConfig.register(); - watchedConfig.keys().forEach(k -> watchedConfigs.put(k, watchedConfig)); - String newConfigText = readURL.apply(watchedConfig.getURL().toString()); - byte[] newConfigHash = computeHash(newConfigText); - if (watchedConfig.isReconfigureNeeded(newConfigHash)) - { - watchedConfig.setConfigHash(newConfigHash); - changeListener.apply(watchedConfig.getURL(), newConfigText); - } - } - } - catch (InterruptedException | ClosedWatchServiceException ex) - { - break; - } - } - - return null; - } - - @Override - public CompletableFuture watch( - URL configURL) - { - WatchedConfig watchedConfig = new WatchedConfig(configURL, watchService); - watchedConfig.register(); - watchedConfig.keys().forEach(k -> watchedConfigs.put(k, watchedConfig)); - String configText = readURL.apply(configURL.toString()); - watchedConfig.setConfigHash(computeHash(configText)); - - CompletableFuture configFuture; - try - { - EngineConfig config = changeListener.apply(configURL, configText); - configFuture = CompletableFuture.completedFuture(config); - } - catch (Exception ex) - { - configFuture = CompletableFuture.failedFuture(ex); - } - - return configFuture; - } - - @Override - public void close() throws IOException - { - watchService.close(); - } -} diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/HttpWatcherTask.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/HttpWatcherTask.java deleted file mode 100644 index c4567ad7fa..0000000000 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/HttpWatcherTask.java +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright 2021-2023 Aklivity Inc. - * - * Aklivity licenses this file to you under the Apache License, - * version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -package io.aklivity.zilla.runtime.engine.internal.registry; - -import static java.net.http.HttpClient.Redirect.NORMAL; -import static java.net.http.HttpClient.Version.HTTP_2; -import static org.agrona.LangUtil.rethrowUnchecked; - -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.Arrays; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.Future; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; -import java.util.function.BiFunction; - -import io.aklivity.zilla.runtime.engine.config.EngineConfig; - -public class HttpWatcherTask extends WatcherTask -{ - private static final URI CLOSE_REQUESTED = URI.create("http://localhost:12345"); - - private final Map etags; - private final Map configHashes; - private final Map> futures; - private final BlockingQueue configQueue; - private final int pollSeconds; - - public HttpWatcherTask( - BiFunction changeListener, - int pollSeconds) - { - super(changeListener); - this.etags = new ConcurrentHashMap<>(); - this.configHashes = new ConcurrentHashMap<>(); - this.futures = new ConcurrentHashMap<>(); - this.configQueue = new LinkedBlockingQueue<>(); - this.pollSeconds = pollSeconds; - } - - @Override - public Future submit() - { - return executor.submit(this); - } - - @Override - public Void call() throws InterruptedException - { - while (true) - { - URI configURI = configQueue.take(); - if (configURI == CLOSE_REQUESTED) - { - break; - } - String etag = etags.getOrDefault(configURI, ""); - sendAsync(configURI, etag); - } - return null; - } - - @Override - public CompletableFuture watch( - URL configURL) - { - URI configURI = toURI(configURL); - - CompletableFuture configFuture; - try - { - EngineConfig config = sendSync(configURI); - configFuture = CompletableFuture.completedFuture(config); - } - catch (Exception ex) - { - configFuture = CompletableFuture.failedFuture(ex); - } - - return configFuture; - } - - @Override - public void close() - { - futures.values().forEach(future -> future.cancel(true)); - configQueue.add(CLOSE_REQUESTED); - } - - private EngineConfig sendSync( - URI configURI) - { - HttpClient client = HttpClient.newBuilder() - .version(HTTP_2) - .followRedirects(NORMAL) - .build(); - HttpRequest request = HttpRequest.newBuilder() - .GET() - .uri(configURI) - .build(); - HttpResponse response; - try - { - response = client.send(request, HttpResponse.BodyHandlers.ofString()); - } - catch (Exception ex) - { - handleException(ex, configURI); - return null; - } - return handleConfigChange(response); - } - - private void sendAsync( - URI configURI, - String etag) - { - HttpClient client = HttpClient.newBuilder() - .version(HTTP_2) - .followRedirects(NORMAL) - .build(); - HttpRequest.Builder requestBuilder = HttpRequest.newBuilder() - .GET() - .uri(configURI); - if (etag != null && !etag.isEmpty()) - { - requestBuilder = requestBuilder.headers("If-None-Match", etag, "Prefer", "wait=86400"); - } - - CompletableFuture future = client.sendAsync(requestBuilder.build(), HttpResponse.BodyHandlers.ofString()) - .thenAccept(this::handleConfigChange) - .exceptionally(ex -> handleException(ex, configURI)); - futures.put(configURI, future); - } - - private Void handleException( - Throwable throwable, - URI configURI) - { - scheduleRequest(configURI, pollSeconds); - return null; - } - - private EngineConfig handleConfigChange( - HttpResponse response) - { - EngineConfig config = null; - try - { - URI configURI = response.request().uri(); - int statusCode = response.statusCode(); - int pollIntervalSeconds = 0; - if (statusCode == 404) - { - config = changeListener.apply(configURI.toURL(), ""); - pollIntervalSeconds = this.pollSeconds; - } - else if (statusCode >= 500 && statusCode <= 599) - { - pollIntervalSeconds = this.pollSeconds; - } - else - { - Optional etagOptional = response.headers().firstValue("Etag"); - String configText = response.body(); - - if (etagOptional.isPresent()) - { - String oldEtag = etags.getOrDefault(configURI, ""); - if (!oldEtag.equals(etagOptional.get())) - { - etags.put(configURI, etagOptional.get()); - config = changeListener.apply(configURI.toURL(), configText); - } - else if (response.statusCode() != 304) - { - pollIntervalSeconds = this.pollSeconds; - } - } - else - { - byte[] configHash = configHashes.get(configURI); - byte[] newConfigHash = computeHash(configText); - if (!Arrays.equals(configHash, newConfigHash)) - { - configHashes.put(configURI, newConfigHash); - config = changeListener.apply(configURI.toURL(), configText); - } - pollIntervalSeconds = this.pollSeconds; - } - } - futures.remove(configURI); - scheduleRequest(configURI, pollIntervalSeconds); - } - catch (MalformedURLException ex) - { - rethrowUnchecked(ex); - } - return config; - } - - private void scheduleRequest(URI configURI, int pollIntervalSeconds) - { - if (pollIntervalSeconds == 0) - { - configQueue.add(configURI); - } - else - { - executor.schedule(() -> configQueue.add(configURI), pollIntervalSeconds, TimeUnit.SECONDS); - } - } - - private URI toURI( - URL configURL) - { - URI configURI = null; - try - { - configURI = configURL.toURI(); - } - catch (URISyntaxException ex) - { - rethrowUnchecked(ex); - } - return configURI; - } -} diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/WatchedConfig.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/WatchedConfig.java deleted file mode 100644 index a6ee866978..0000000000 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/WatchedConfig.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright 2021-2023 Aklivity Inc. - * - * Aklivity licenses this file to you under the Apache License, - * version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -package io.aklivity.zilla.runtime.engine.internal.registry; - -import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE; -import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE; -import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY; -import static org.agrona.LangUtil.rethrowUnchecked; - -import java.io.IOException; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.WatchKey; -import java.nio.file.WatchService; -import java.util.Arrays; -import java.util.Deque; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.Set; - -public class WatchedConfig -{ - private final WatchService watchService; - private final Set watchKeys; - private final URL configURL; - private byte[] configHash; - - public WatchedConfig( - URL configURL, - WatchService watchService) - { - this.watchService = watchService; - this.watchKeys = new HashSet<>(); - this.configURL = configURL; - } - - public Set keys() - { - return watchKeys; - } - - public void register() - { - Path configPath = Paths.get(configURL.getPath()).toAbsolutePath(); - try - { - Set watchedPaths = new HashSet<>(); - - Deque observablePaths = new LinkedList<>(); - observablePaths.addLast(configPath); - - while (!observablePaths.isEmpty()) - { - Path observablePath = observablePaths.removeFirst(); - - if (watchedPaths.add(observablePath)) - { - if (Files.isSymbolicLink(observablePath)) - { - Path targetPath = Files.readSymbolicLink(observablePath); - targetPath = configPath.resolveSibling(targetPath).normalize(); - observablePaths.addLast(targetPath); - } - - for (Path ancestorPath = observablePath.getParent(); - ancestorPath != null; - ancestorPath = ancestorPath.getParent()) - { - if (Files.isSymbolicLink(ancestorPath)) - { - if (watchedPaths.add(ancestorPath)) - { - Path targetPath = Files.readSymbolicLink(ancestorPath); - observablePaths.addLast(ancestorPath.resolve(targetPath).normalize()); - } - } - } - } - } - - for (Path watchedPath : watchedPaths) - { - if (Files.exists(watchedPath.getParent())) - { - WatchKey key = registerPath(watchedPath.getParent()); - watchKeys.add(key); - } - } - } - catch (IOException ex) - { - rethrowUnchecked(ex); - } - } - - public void unregister() - { - watchKeys.forEach(WatchKey::cancel); - watchKeys.clear(); - } - - public boolean isWatchedKey( - WatchKey key) - { - return watchKeys.contains(key); - } - - public boolean isReconfigureNeeded( - byte[] newConfigHash) - { - return !Arrays.equals(configHash, newConfigHash); - } - - public void setConfigHash( - byte[] newConfigHash) - { - configHash = newConfigHash; - } - - public URL getURL() - { - return configURL; - } - - private WatchKey registerPath( - Path configPath) - { - WatchKey key = null; - try - { - key = configPath.register(watchService, ENTRY_MODIFY, ENTRY_CREATE, ENTRY_DELETE); - } - catch (IOException ex) - { - rethrowUnchecked(ex); - } - return key; - } - - private Path toRealPath( - Path configPath) - { - try - { - configPath = configPath.toRealPath(); - } - catch (IOException ex) - { - rethrowUnchecked(ex); - } - return configPath; - } - -} diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/WatcherTask.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/WatcherTask.java deleted file mode 100644 index 0bfc9e64e5..0000000000 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/WatcherTask.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2021-2023 Aklivity Inc. - * - * Aklivity licenses this file to you under the Apache License, - * version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -package io.aklivity.zilla.runtime.engine.internal.registry; - -import static java.nio.charset.StandardCharsets.UTF_8; -import static org.agrona.LangUtil.rethrowUnchecked; - -import java.io.Closeable; -import java.net.URL; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.concurrent.Callable; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.ScheduledExecutorService; -import java.util.function.BiFunction; - -import io.aklivity.zilla.runtime.engine.config.EngineConfig; - -public abstract class WatcherTask implements Callable, Closeable -{ - private final MessageDigest md5; - - protected final ScheduledExecutorService executor; - protected final BiFunction changeListener; - - protected WatcherTask( - BiFunction changeListener) - { - this.changeListener = changeListener; - this.md5 = initMessageDigest("MD5"); - this.executor = Executors.newScheduledThreadPool(2); - } - - public abstract Future submit(); - - public abstract CompletableFuture watch( - URL configURL); - - protected byte[] computeHash( - String configText) - { - return md5.digest(configText.getBytes(UTF_8)); - } - - private MessageDigest initMessageDigest( - String algorithm) - { - MessageDigest md5 = null; - try - { - md5 = MessageDigest.getInstance(algorithm); - } - catch (NoSuchAlgorithmException ex) - { - rethrowUnchecked(ex); - } - return md5; - } -} diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/watcher/EngineConfigWatchTask.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/watcher/EngineConfigWatchTask.java new file mode 100644 index 0000000000..df6854b2da --- /dev/null +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/watcher/EngineConfigWatchTask.java @@ -0,0 +1,112 @@ +/* + * Copyright 2021-2023 Aklivity Inc. + * + * Aklivity licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.aklivity.zilla.runtime.engine.internal.watcher; + +import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE; +import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE; +import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY; +import static org.agrona.LangUtil.rethrowUnchecked; + +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.WatchKey; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.Callable; + +import io.aklivity.zilla.runtime.engine.EngineConfiguration; +import io.aklivity.zilla.runtime.engine.internal.event.EngineEventContext; + +public abstract class EngineConfigWatchTask implements AutoCloseable, Callable +{ + private final Path configPath; + private final EngineConfigWatcher watcher; + private Map resourceKeys; + + protected EngineConfigWatchTask( + EngineConfiguration config, + EngineEventContext events, + Path configPath) + { + this.configPath = configPath; + this.watcher = new EngineConfigWatcher(config, events, configPath.getFileSystem()); + this.resourceKeys = new HashMap<>(); + } + + public void submit() + { + onPathChanged(configPath); + watcher.submit(this); + } + + public void watch( + String resource) + { + try + { + Path resourcePath = configPath.resolveSibling(resource); + WatchKey resourceKey = watcher.register(resourcePath, ENTRY_MODIFY, ENTRY_CREATE, ENTRY_DELETE); + resourceKeys.put(resource, resourceKey); + } + catch (IOException ex) + { + rethrowUnchecked(ex); + } + } + + public void unwatch( + String resource) + { + WatchKey resourceKey = resourceKeys.remove(resource); + + if (resourceKey != null) + { + resourceKey.cancel(); + } + } + + @Override + public final Void call() throws IOException + { + watcher.register(configPath, ENTRY_MODIFY, ENTRY_CREATE, ENTRY_DELETE); + + while (true) + { + try + { + final WatchKey key = watcher.take(); + final Path watchable = (Path) key.watchable(); + onPathChanged(watchable); + } + catch (InterruptedException ex) + { + watcher.close(); + break; + } + } + + return null; + } + + @Override + public final void close() + { + watcher.close(); + } + + protected abstract void onPathChanged( + Path watchedPath); +} diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/watcher/EngineConfigWatcher.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/watcher/EngineConfigWatcher.java new file mode 100644 index 0000000000..1f235ed912 --- /dev/null +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/watcher/EngineConfigWatcher.java @@ -0,0 +1,305 @@ +/* + * Copyright 2021-2023 Aklivity Inc. + * + * Aklivity licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.aklivity.zilla.runtime.engine.internal.watcher; + +import static org.agrona.LangUtil.rethrowUnchecked; + +import java.io.IOException; +import java.nio.file.FileSystem; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.WatchEvent; +import java.nio.file.WatchEvent.Kind; +import java.nio.file.WatchEvent.Modifier; +import java.nio.file.WatchKey; +import java.nio.file.WatchService; +import java.util.Deque; +import java.util.HashMap; +import java.util.HashSet; +import java.util.IdentityHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.function.Function; + +import org.agrona.CloseHelper; +import org.agrona.LangUtil; + +import io.aklivity.zilla.runtime.engine.EngineConfiguration; +import io.aklivity.zilla.runtime.engine.internal.event.EngineEventContext; + +public final class EngineConfigWatcher implements AutoCloseable +{ + private static final Function>> LOOKUP_RESOLVER; + static + { + Map>> resolvers = new HashMap<>(); + resolvers.put("http", Set::of); + + Function> defaultResolver = EngineConfigWatcher::resolveWatchables; + LOOKUP_RESOLVER = scheme -> resolvers.getOrDefault(scheme, defaultResolver); + } + + private final Function> resolver; + private final WatchService watcher; + private final Map compoundKeys; + private final ExecutorService executor; + + public EngineConfigWatcher( + EngineConfiguration config, + EngineEventContext events, + FileSystem fileSystem) + { + this.resolver = LOOKUP_RESOLVER.apply(fileSystem.provider().getScheme()); + this.watcher = newWatchService(config, events, fileSystem); + this.executor = watcher != null ? Executors.newScheduledThreadPool(2) : null; + this.compoundKeys = new IdentityHashMap<>(); + } + + public void submit( + EngineConfigWatchTask task) + { + if (executor != null) + { + executor.submit(task); + } + } + + public WatchKey register( + Path watchable, + WatchEvent.Kind... events) throws IOException + { + return register(watchable, events, new WatchEvent.Modifier[0]); + } + + public WatchKey register( + Path watchable, + Kind[] events, + Modifier... modifiers) throws IOException + { + WatchKey watchKey = null; + + if (watcher != null) + { + watchKey = registerImpl(watchable, events, modifiers); + } + + return watchKey; + } + + public WatchKey take() throws InterruptedException + { + return watcher != null ? takeImpl() : null; + } + + @Override + public void close() + { + if (watcher != null) + { + CloseHelper.quietClose(watcher); + } + + if (executor != null) + { + executor.shutdownNow(); + } + } + + private WatchKey registerImpl( + Path watchable, + Kind[] events, + Modifier... modifiers) throws IOException + { + Set watchPaths = resolver.apply(watchable); + Set watchKeys = new HashSet<>(); + + for (Path watchPath : watchPaths) + { + WatchKey registeredKey = watchPath.register(watcher, events, modifiers); + watchKeys.add(registeredKey); + } + + CompoundWatchKey compoundKey = new CompoundWatchKey(watchable, watchKeys); + watchKeys.forEach(k -> compoundKeys.put(k, compoundKey)); + + return compoundKey; + } + + private WatchKey takeImpl() throws InterruptedException + { + WatchKey watchKey = watcher.take(); + CompoundWatchKey compoundKey = compoundKeys.get(watchKey); + + return compoundKey; + } + + private final class CompoundWatchKey implements WatchKey + { + private final Path watchable; + private final Set keys; + private final List> events; + + CompoundWatchKey( + Path watchable, + Set keys) + { + this.watchable = watchable; + this.keys = keys; + this.events = new LinkedList<>(); + } + + @Override + public boolean isValid() + { + return keys.stream().allMatch(WatchKey::isValid); + } + + @Override + public List> pollEvents() + { + List> events = this.events; + + events.clear(); + for (WatchKey key : keys) + { + // TODO filter watch events + events.addAll(key.pollEvents()); + } + + return events; + } + + @Override + public boolean reset() + { + return keys.stream().allMatch(WatchKey::reset); + } + + @Override + public void cancel() + { + keys.stream().forEach(WatchKey::cancel); + keys.forEach(compoundKeys::remove); + } + + @Override + public Path watchable() + { + return watchable; + } + } + + private static Set resolveWatchables( + Path watchable) + { + Set watchedPaths = new HashSet<>(); + + Deque observablePaths = new LinkedList<>(); + observablePaths.addLast(watchable); + + while (!observablePaths.isEmpty()) + { + Path observablePath = observablePaths.removeFirst(); + + if (watchedPaths.add(observablePath)) + { + if (Files.isSymbolicLink(observablePath)) + { + Path targetPath = readSymbolicLink(observablePath); + targetPath = watchable.resolveSibling(targetPath).normalize(); + observablePaths.addLast(targetPath); + } + + for (Path ancestorPath = observablePath.getParent(); + ancestorPath != null; + ancestorPath = ancestorPath.getParent()) + { + if (Files.isSymbolicLink(ancestorPath)) + { + if (watchedPaths.add(ancestorPath)) + { + Path targetPath = readSymbolicLink(ancestorPath); + observablePaths.addLast(ancestorPath.resolve(targetPath).normalize()); + } + } + } + } + } + + Set watchables = new HashSet<>(); + for (Path watchedPath : watchedPaths) + { + Path parentPath = watchedPath.getParent(); + if (Files.exists(parentPath)) + { + watchables.add(parentPath); + } + } + + return watchables; + } + + private static Path readSymbolicLink( + Path link) + { + Path target = null; + + try + { + target = Files.readSymbolicLink(link); + } + catch (IOException ex) + { + LangUtil.rethrowUnchecked(ex); + } + + return target; + } + + private static WatchService newWatchService( + EngineConfiguration config, + EngineEventContext events, + FileSystem fileSystem) + { + WatchService watcher = null; + + if (config.configWatch()) + { + try + { + watcher = fileSystem.newWatchService(); + } + catch (UnsupportedOperationException ex) + { + // not supported (optional) + } + catch (IOException ex) + { + events.configWatcherFailed(0L, ex.getMessage()); + } + catch (Throwable ex) + { + rethrowUnchecked(ex); + } + } + + return watcher; + } +} diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/metrics/reader/HistogramRecord.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/metrics/reader/HistogramRecord.java index 4f919490d6..c12d76b8a9 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/metrics/reader/HistogramRecord.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/metrics/reader/HistogramRecord.java @@ -23,8 +23,12 @@ import java.util.function.LongFunction; import java.util.function.LongSupplier; +import org.agrona.collections.Int2IntHashMap; + public class HistogramRecord implements MetricRecord { + private static final Int2IntHashMap MS_BUCKET_MAP = generateMillisecondsBucketMap(); + private final long bindingId; private final long metricId; private final int namespaceId; @@ -32,6 +36,7 @@ public class HistogramRecord implements MetricRecord private final LongFunction labelResolver; private long[] bucketValues = new long[BUCKETS]; + private long[] millisecondBucketValues = null; public HistogramRecord( long bindingId, @@ -87,6 +92,7 @@ public void update() { bucketValues[i] = readers[i].getAsLong(); } + millisecondBucketValues = null; } public long[] bucketValues() @@ -94,7 +100,36 @@ public long[] bucketValues() return bucketValues; } + public long[] millisecondBucketValues() + { + if (millisecondBucketValues == null) + { + millisecondBucketValues = new long[BUCKETS]; + for (int i = 0; i < BUCKETS; i++) + { + int msIndex = MS_BUCKET_MAP.get(i); + millisecondBucketValues[msIndex] += bucketValues[i]; + } + } + return millisecondBucketValues; + } + public long[] stats() + { + return stats(bucketValues); + } + + public long[] millisecondStats() + { + if (millisecondBucketValues == null) + { + millisecondBucketValues(); + } + return stats(millisecondBucketValues); + } + + private long[] stats( + long[] bucketValues) { long count = 0L; long sum = 0L; @@ -121,7 +156,6 @@ public long[] stats() return new long[]{minimum, maximum, sum, count, average}; } - private long getValue( int index) { @@ -149,4 +183,74 @@ public int hashCode() { return Objects.hash(namespaceId, bindingId, metricId); } + + private static Int2IntHashMap generateMillisecondsBucketMap() + { + Int2IntHashMap map = new Int2IntHashMap(-1); + // source bucket index -> dividing source bucket limit by 1 million -> destination bucket index + map.put(0, 0); // 2 -> 2 + map.put(1, 0); // 4 -> 2 + map.put(2, 0); // 8 -> 2 + map.put(3, 0); // 16 -> 2 + map.put(4, 0); // 32 -> 2 + map.put(5, 0); // 64 -> 2 + map.put(6, 0); // 128 -> 2 + map.put(7, 0); // 256 -> 2 + map.put(8, 0); // 512 -> 2 + map.put(9, 0); // 1024 -> 2 + map.put(10, 0); // 2048 -> 2 + map.put(11, 0); // 4096 -> 2 + map.put(12, 0); // 8192 -> 2 + map.put(13, 0); // 16384 -> 2 + map.put(14, 0); // 32768 -> 2 + map.put(15, 0); // 65536 -> 2 + map.put(16, 0); // 131072 -> 2 + map.put(17, 0); // 262144 -> 2 + map.put(18, 0); // 524288 -> 2 + map.put(19, 0); // 1048576 -> 2 + map.put(20, 1); // 2097152 -> 4 + map.put(21, 2); // 4194304 -> 4 + map.put(22, 3); // 8388608 -> 8 + map.put(23, 4); // 16777216 -> 16 + map.put(24, 5); // 33554432 -> 33 + map.put(25, 6); // 67108864 -> 67 + map.put(26, 7); // 134217728 -> 134 + map.put(27, 8); // 268435456 -> 268 + map.put(28, 9); // 536870912 -> 536 + map.put(29, 10); // 1073741824 -> 1073 + map.put(30, 11); // 2147483648 -> 2147 + map.put(31, 12); // 4294967296 -> 4294 + map.put(32, 13); // 8589934592 -> 8589 + map.put(33, 14); // 17179869184 -> 17179 + map.put(34, 15); // 34359738368 -> 34359 + map.put(35, 16); // 68719476736 -> 68719 + map.put(36, 17); // 137438953472 -> 137438 + map.put(37, 18); // 274877906944 -> 274877 + map.put(38, 19); // 549755813888 -> 549755 + map.put(39, 20); // 1099511627776 -> 1099511 + map.put(40, 21); // 2199023255552 -> 2199023 + map.put(41, 22); // 4398046511104 -> 4398046 + map.put(42, 23); // 8796093022208 -> 8796093 + map.put(43, 24); // 17592186044416 -> 17592186 + map.put(44, 25); // 35184372088832 -> 35184372 + map.put(45, 26); // 70368744177664 -> 70368744 + map.put(46, 27); // 140737488355328 -> 140737488 + map.put(47, 28); // 281474976710656 -> 281474976 + map.put(48, 29); // 562949953421312 -> 562949953 + map.put(49, 30); // 1125899906842624 -> 1125899906 + map.put(50, 31); // 2251799813685248 -> 2251799813 + map.put(51, 32); // 4503599627370496 -> 4503599627 + map.put(52, 33); // 9007199254740992 -> 9007199254 + map.put(53, 34); // 18014398509481984 -> 18014398509 + map.put(54, 35); // 36028797018963968 -> 36028797018 + map.put(55, 36); // 72057594037927936 -> 72057594037 + map.put(56, 37); // 144115188075855872 -> 144115188075 + map.put(57, 38); // 288230376151711744 -> 288230376151 + map.put(58, 39); // 576460752303423488 -> 576460752303 + map.put(59, 40); // 1152921504606846976 -> 1152921504606 + map.put(60, 41); // 2305843009213693952 -> 2305843009213 + map.put(61, 42); // 4611686018427387904 -> 4611686018427 + map.put(62, 43); + return map; + } } diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/metrics/reader/ScalarRecord.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/metrics/reader/ScalarRecord.java index ef87f5af01..3edf4e1097 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/metrics/reader/ScalarRecord.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/metrics/reader/ScalarRecord.java @@ -18,6 +18,7 @@ import static io.aklivity.zilla.runtime.engine.namespace.NamespacedId.namespaceId; import java.util.Objects; +import java.util.function.DoubleSupplier; import java.util.function.LongFunction; import java.util.function.LongSupplier; @@ -72,6 +73,11 @@ public LongSupplier valueReader() return this.reader; } + public DoubleSupplier millisecondsValueReader() + { + return () -> (double) this.valueReader().getAsLong() / 1_000_000L; + } + @Override public boolean equals( Object o) diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/model/ConverterHandler.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/model/ConverterHandler.java index ca8231a93b..fc7c9c95d9 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/model/ConverterHandler.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/model/ConverterHandler.java @@ -30,6 +30,20 @@ public interface ConverterHandler return length; }; + @FunctionalInterface + interface FieldVisitor + { + void visit( + DirectBuffer buffer, + int index, + int length); + } + + default void extract( + String path) + { + } + int convert( long traceId, long bindingId, @@ -38,6 +52,18 @@ int convert( int length, ValueConsumer next); + default int extractedLength( + String path) + { + return 0; + } + + default void extracted( + String path, + FieldVisitor visitor) + { + } + default int padding( DirectBuffer data, int index, diff --git a/runtime/engine/src/main/moditect/module-info.java b/runtime/engine/src/main/moditect/module-info.java index 529ca971b7..92a07f0854 100644 --- a/runtime/engine/src/main/moditect/module-info.java +++ b/runtime/engine/src/main/moditect/module-info.java @@ -53,6 +53,9 @@ requires org.slf4j; requires io.aklivity.zilla.runtime.common; + provides io.aklivity.zilla.runtime.engine.event.EventFormatterFactorySpi + with io.aklivity.zilla.runtime.engine.internal.event.EngineEventFormatterFactory; + uses io.aklivity.zilla.runtime.engine.config.ConditionConfigAdapterSpi; uses io.aklivity.zilla.runtime.engine.config.CompositeBindingAdapterSpi; uses io.aklivity.zilla.runtime.engine.config.OptionsConfigAdapterSpi; diff --git a/runtime/engine/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.event.EventFormatterFactorySpi b/runtime/engine/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.event.EventFormatterFactorySpi new file mode 100644 index 0000000000..5af6c368a5 --- /dev/null +++ b/runtime/engine/src/main/resources/META-INF/services/io.aklivity.zilla.runtime.engine.event.EventFormatterFactorySpi @@ -0,0 +1 @@ +io.aklivity.zilla.runtime.engine.internal.event.EngineEventFormatterFactory diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/EngineIT.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/EngineIT.java index a0713f833d..99e83efde7 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/EngineIT.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/EngineIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/ReconfigureFileIT.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/ReconfigureFileIT.java index d4be4ef1a0..9168f0750e 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/ReconfigureFileIT.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/ReconfigureFileIT.java @@ -36,9 +36,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/ReconfigureHttpIT.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/ReconfigureHttpIT.java index c4dea0780b..5abc52c836 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/ReconfigureHttpIT.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/ReconfigureHttpIT.java @@ -28,14 +28,13 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; - public class ReconfigureHttpIT { public static final String ENGINE_CONFIG_POLL_INTERVAL_SECONDS = "zilla.engine.config.poll.interval.seconds"; @@ -68,58 +67,59 @@ public void setupRegisterLatch() throws Exception } @Test - @Configure(name = ENGINE_CONFIG_POLL_INTERVAL_SECONDS, value = "1") - @Configuration("http://localhost:8080/") + @Configure(name = ENGINE_CONFIG_POLL_INTERVAL_SECONDS, value = "0") + @Configuration("http://localhost:8080/zilla.yaml") @Specification({ - "${app}/reconfigure.modify.via.http/server", - "${net}/reconfigure.modify.via.http/client" + "${app}/reconfigure.create.via.http/server", + "${net}/reconfigure.create.via.http/client" }) - public void shouldReconfigureWhenModifiedHttp() throws Exception + public void shouldReconfigureWhenCreatedViaHttp() throws Exception { k3po.start(); - k3po.awaitBarrier("CONNECTED"); EngineTest.TestEngineExt.registerLatch.await(); - k3po.notifyBarrier("CONFIG_CHANGED"); + k3po.notifyBarrier("CONFIG_CREATED"); k3po.finish(); } @Test - @Configure(name = ENGINE_CONFIG_POLL_INTERVAL_SECONDS, value = "1") - @Configuration("http://localhost:8080/") + @Configure(name = ENGINE_CONFIG_POLL_INTERVAL_SECONDS, value = "0") + @Configuration("http://localhost:8080/zilla.yaml") @Specification({ - "${app}/reconfigure.create.via.http/server", - "${net}/reconfigure.create.via.http/client" + "${app}/reconfigure.delete.via.http/server", + "${net}/reconfigure.delete.via.http/client" }) - public void shouldReconfigureWhenCreatedHttp() throws Exception + public void shouldReconfigureWhenDeletedViaHttp() throws Exception { k3po.start(); EngineTest.TestEngineExt.registerLatch.await(); - k3po.notifyBarrier("CONFIG_CREATED"); + k3po.notifyBarrier("CONFIG_DELETED"); k3po.finish(); } @Test - @Configuration("http://localhost:8080/") + @Configure(name = ENGINE_CONFIG_POLL_INTERVAL_SECONDS, value = "0") + @Configuration("http://localhost:8080/zilla.yaml") @Specification({ - "${app}/reconfigure.delete.via.http/server", - "${net}/reconfigure.delete.via.http/client" + "${app}/reconfigure.modify.via.http/server", + "${net}/reconfigure.modify.via.http/client" }) - public void shouldReconfigureWhenDeletedHttp() throws Exception + public void shouldReconfigureWhenModifiedViaHttp() throws Exception { k3po.start(); + k3po.awaitBarrier("CONNECTED"); EngineTest.TestEngineExt.registerLatch.await(); - k3po.notifyBarrier("CONFIG_DELETED"); + k3po.notifyBarrier("CONFIG_CHANGED"); k3po.finish(); } @Test - @Configure(name = ENGINE_CONFIG_POLL_INTERVAL_SECONDS, value = "1") - @Configuration("http://localhost:8080/") + @Configure(name = ENGINE_CONFIG_POLL_INTERVAL_SECONDS, value = "0") + @Configuration("http://localhost:8080/zilla.yaml") @Specification({ "${app}/reconfigure.modify.no.etag.via.http/server", "${net}/reconfigure.modify.no.etag.via.http/client" }) - public void shouldReconfigureWhenModifiedHttpEtagNotSupported() throws Exception + public void shouldReconfigureWhenModifiedViaHttpWithNoEtag() throws Exception { k3po.start(); k3po.awaitBarrier("CONNECTED"); @@ -129,13 +129,13 @@ public void shouldReconfigureWhenModifiedHttpEtagNotSupported() throws Exception } @Test - @Configure(name = ENGINE_CONFIG_POLL_INTERVAL_SECONDS, value = "1") - @Configuration("http://localhost:8080/") + @Configure(name = ENGINE_CONFIG_POLL_INTERVAL_SECONDS, value = "0") + @Configuration("http://localhost:8080/zilla.yaml") @Specification({ "${app}/reconfigure.server.error.via.http/server", "${net}/reconfigure.server.error.via.http/client" }) - public void shouldNotReconfigureWhenStatus500() throws Exception + public void shouldNotReconfigureViaHttpWhenServerError() throws Exception { k3po.start(); k3po.awaitBarrier("CHECK_RECONFIGURE"); diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/event/EngineEventIT.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/event/EngineEventIT.java new file mode 100644 index 0000000000..49101f5809 --- /dev/null +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/internal/event/EngineEventIT.java @@ -0,0 +1,66 @@ +/* + * Copyright 2021-2023 Aklivity Inc. + * + * Aklivity licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.aklivity.zilla.runtime.engine.internal.event; + +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.rules.RuleChain.outerRule; + +import org.jboss.byteman.contrib.bmunit.BMScript; +import org.jboss.byteman.contrib.bmunit.BMUnitConfig; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.DisableOnDebug; +import org.junit.rules.TestRule; +import org.junit.rules.Timeout; +import org.junit.runner.RunWith; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; +import io.aklivity.zilla.runtime.engine.test.EngineRule; +import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; + +@RunWith(org.jboss.byteman.contrib.bmunit.BMUnitRunner.class) +@BMUnitConfig(loadDirectory = "src/test/resources") +@BMScript(value = "FileSystemHelper.btm") +public class EngineEventIT +{ + private final K3poRule k3po = new K3poRule() + .addScriptRoot("net", "io/aklivity/zilla/specs/engine/streams/network") + .addScriptRoot("app", "io/aklivity/zilla/specs/engine/streams/application"); + + private final TestRule timeout = new DisableOnDebug(new Timeout(10, SECONDS)); + + private final EngineRule engine = new EngineRule() + .directory("target/zilla-itests") + .countersBufferCapacity(4096) + .configurationRoot("io/aklivity/zilla/specs/engine/config") + .external("app0") + .clean(); + + @Rule + public final TestRule chain = outerRule(engine).around(k3po).around(timeout); + + @Test + @Configuration("engine.events.yaml") + @Specification({ + "${net}/handshake/client", + "${app}/handshake/server" + }) + public void shouldLogEvents() throws Exception + { + k3po.finish(); + } +} diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/metrics/reader/HistogramRecordTest.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/metrics/reader/HistogramRecordTest.java index 528f5d77d3..375db6cc8c 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/metrics/reader/HistogramRecordTest.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/metrics/reader/HistogramRecordTest.java @@ -15,8 +15,8 @@ */ package io.aklivity.zilla.runtime.engine.metrics.reader; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -import static org.junit.Assert.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -40,6 +40,17 @@ public class HistogramRecordTest () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L }; + public static final LongSupplier[] READER_HISTOGRAM_MS = new LongSupplier[] + { + () -> 0L, () -> 1L, () -> 2L, () -> 0L, () -> 3L, () -> 0L, () -> 0L, () -> 0L, + () -> 0L, () -> 0L, () -> 4L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, + () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, + () -> 0L, () -> 4L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, + () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 2L, () -> 0L, () -> 0L, + () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, + () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, () -> 0L, + () -> 0L, () -> 3L, () -> 0L, () -> 0L, () -> 1L, () -> 0L, () -> 0L + }; @Test public void shouldResolveFields() @@ -75,6 +86,34 @@ public void shouldResolveFields() assertThat(stats[4], equalTo(50_518L)); // avg } + @Test + public void shouldResolveTimeInMilliseconds() + { + // GIVEN + LongFunction labelResolver = mock(LongFunction.class); + long bindingId = NamespacedId.id(77, 7); + long metricId = NamespacedId.id(77, 8); + HistogramRecord histogram = new HistogramRecord(bindingId, metricId, READER_HISTOGRAM_MS, labelResolver); + + // WHEN + histogram.update(); + int buckets = histogram.buckets(); + long[] value = histogram.millisecondBucketValues(); + long[] stats = histogram.millisecondStats(); + + // THEN + assertThat(buckets, equalTo(63)); + assertThat(value[0], equalTo(10L)); + assertThat(value[18], equalTo(2L)); + assertThat(value[38], equalTo(3L)); + assertThat(value[41], equalTo(1L)); + assertThat(stats[0], equalTo(1L)); // min + assertThat(stats[1], equalTo(4_398_046_511_103L)); // max + assertThat(stats[2], equalTo(6_047_315_001_856L)); // sum + assertThat(stats[3], equalTo(20L)); // cnt + assertThat(stats[4], equalTo(302_365_750_092L)); // avg + } + @Test public void shouldReturnZeroStatsWhenEmpty() { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/metrics/reader/ScalarRecordTest.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/metrics/reader/ScalarRecordTest.java index d2cb22f3ea..1aba0e24e6 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/metrics/reader/ScalarRecordTest.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/metrics/reader/ScalarRecordTest.java @@ -15,8 +15,8 @@ */ package io.aklivity.zilla.runtime.engine.metrics.reader; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -import static org.junit.Assert.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -30,6 +30,7 @@ public class ScalarRecordTest { private static final LongSupplier READER_42 = () -> 42L; + private static final LongSupplier READER_42_M = () -> 42_005_000L; @Test public void shouldResolveFields() @@ -55,4 +56,20 @@ public void shouldResolveFields() assertThat(metricName, equalTo("metric1")); assertThat(value, equalTo(42L)); } + + @Test + public void shouldResolveTimeInMilliseconds() + { + // GIVEN + LongFunction labelResolver = mock(LongFunction.class); + long bindingId = NamespacedId.id(77, 7); + long metricId = NamespacedId.id(77, 8); + ScalarRecord scalar = new ScalarRecord(bindingId, metricId, READER_42_M, labelResolver); + + // WHEN + double millisecondsValue = scalar.millisecondsValueReader().getAsDouble(); + + // THEN + assertThat(millisecondsValue, equalTo(42.005)); + } } diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/EngineRule.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/EngineRule.java index 44278f08cf..3a455f474a 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/EngineRule.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/EngineRule.java @@ -31,11 +31,14 @@ import java.io.IOException; import java.net.URI; import java.net.URL; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Map; import java.util.Properties; import java.util.function.LongConsumer; import java.util.function.LongSupplier; @@ -73,7 +76,7 @@ public final class EngineRule implements TestRule private Engine engine; private EngineConfiguration configuration; - private String configurationRoot; + private String configRoot; private Predicate exceptions; private boolean clean; @@ -122,7 +125,7 @@ public EngineRule configure( public EngineRule configurationRoot( String configurationRoot) { - this.configurationRoot = configurationRoot; + this.configRoot = configurationRoot; return this; } @@ -281,9 +284,9 @@ public Statement apply( { configure(ENGINE_CONFIG_URL, configURI.toURL()); } - else if (configurationRoot != null) + else if (configRoot != null) { - String resourceName = String.format("%s/%s", configurationRoot, config.value()); + String resourceName = String.format("%s/%s", configRoot, config.value()); URL configURL = testClass.getClassLoader().getResource(resourceName); configure(ENGINE_CONFIG_URL, configURL); } @@ -309,7 +312,7 @@ else if (configurationRoot != null) @Override public void evaluate() throws Throwable { - EngineConfiguration config = configuration(); + final EngineConfiguration config = configuration(); final Thread baseThread = Thread.currentThread(); final List errors = new ArrayList<>(); final ErrorHandler errorHandler = ex -> @@ -318,6 +321,26 @@ public void evaluate() throws Throwable errors.add(ex); baseThread.interrupt(); }; + + FileSystem fs = null; + + final URI configURI = config.configURI(); + + switch (configURI.getScheme()) + { + case "jar": + String jarLocation = Path.of( + configURI.toString().replace("jar:file:", "").split("!")[0] + ).toUri().toString(); + URI jarURI = new URI("jar", jarLocation, null); + fs = FileSystems.newFileSystem(jarURI, Map.of()); + break; + case "http": + final String pollInterval = String.format("PT%dS", config.configPollIntervalSeconds()); + fs = FileSystems.newFileSystem(configURI, Map.of("zilla.filesystem.http.poll.interval", pollInterval)); + break; + } + engine = builder.config(config) .errorHandler(errorHandler) .build(); @@ -348,6 +371,10 @@ public void evaluate() throws Throwable { assertEmpty(errors); } + if (fs != null) + { + fs.close(); + } } } } diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/EventIT.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/EventIT.java index bb43baa392..d7ab991bf8 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/EventIT.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/EventIT.java @@ -23,9 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; public class EventIT diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/DuplexIT.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/DuplexIT.java index a00df66314..7ead77756d 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/DuplexIT.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/DuplexIT.java @@ -34,8 +34,9 @@ import org.junit.rules.TestRule; import org.junit.rules.Timeout; import org.junit.runners.model.TestTimedOutException; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class DuplexIT { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/HalfDuplexIT.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/HalfDuplexIT.java index 7fbccfdfd1..6792ac2f33 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/HalfDuplexIT.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/HalfDuplexIT.java @@ -34,8 +34,9 @@ import org.junit.rules.TestRule; import org.junit.rules.Timeout; import org.junit.runners.model.TestTimedOutException; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class HalfDuplexIT { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/SimplexIT.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/SimplexIT.java index f2bd132ac2..c1a60f426d 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/SimplexIT.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/SimplexIT.java @@ -30,8 +30,9 @@ import org.junit.rules.ExpectedException; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class SimplexIT { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/TestExporterHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/TestExporterHandler.java index 1588e9ab43..771227e577 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/TestExporterHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/TestExporterHandler.java @@ -68,16 +68,19 @@ private void handleEvent( int length) { final EventFW event = eventRO.wrap(buffer, index, index + length); + String qname = context.supplyQName(event.namespacedId()); String id = context.supplyLocalName(event.id()); + String name = context.supplyEventName(event.id()); String message = formatter.format(msgTypeId, buffer, index, length); + if (options.events != null && eventIndex < options.events.size()) { TestExporterOptionsConfig.Event e = options.events.get(eventIndex); - if (!qname.equals(e.qName) || !id.equals(e.id) || !message.equals(e.message)) + if (!qname.equals(e.qName) || !id.equals(e.id) || !name.equals(e.name) || !message.equals(e.message)) { - throw new IllegalStateException(String.format("event mismatch, expected: %s %s %s, got: %s %s %s", - e.qName, e.id, e.message, qname, id, message)); + throw new IllegalStateException(String.format("event mismatch, expected: %s %s %s %s, actual: %s %s %s %s", + e.qName, e.id, e.name, e.message, qname, id, name, message)); } eventIndex++; } diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfig.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfig.java index ac572a23cc..d148044b07 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfig.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfig.java @@ -48,15 +48,18 @@ public static final class Event { public final String qName; public final String id; + public final String name; public final String message; public Event( - String qName, - String id, - String message) + String qName, + String id, + String name, + String message) { this.qName = qName; this.id = id; + this.name = name; this.message = message; } } diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigAdapter.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigAdapter.java index 2af4e8fdf4..5c119416df 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigAdapter.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigAdapter.java @@ -33,6 +33,7 @@ public final class TestExporterOptionsConfigAdapter implements OptionsConfigAdap private static final String EVENTS_NAME = "events"; private static final String QNAME_NAME = "qname"; private static final String ID_NAME = "id"; + private static final String NAME_NAME = "name"; private static final String MESSAGE_NAME = "message"; @Override @@ -68,6 +69,7 @@ public JsonObject adaptToJson( JsonObjectBuilder event = Json.createObjectBuilder(); event.add(QNAME_NAME, e.qName); event.add(ID_NAME, e.id); + event.add(NAME_NAME, e.name); event.add(MESSAGE_NAME, e.message); events.add(event); } @@ -98,7 +100,12 @@ public OptionsConfig adaptFromJson( JsonObject e0 = e.asJsonObject(); if (e0.containsKey(QNAME_NAME) && e0.containsKey(MESSAGE_NAME)) { - testOptions.event(e0.getString(QNAME_NAME), e0.getString(ID_NAME), e0.getString(MESSAGE_NAME)); + testOptions.event( + e0.getString(QNAME_NAME), + e0.getString(ID_NAME), + e0.getString(NAME_NAME), + e0.getString(MESSAGE_NAME) + ); } } } diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigBuilder.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigBuilder.java index 6b871d36b0..62c9d57776 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigBuilder.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigBuilder.java @@ -52,13 +52,14 @@ public TestExporterOptionsConfigBuilder mode( public TestExporterOptionsConfigBuilder event( String qName, String id, + String name, String message) { if (this.events == null) { this.events = new LinkedList<>(); } - this.events.add(new TestExporterOptionsConfig.Event(qName, id, message)); + this.events.add(new TestExporterOptionsConfig.Event(qName, id, name, message)); return this; } diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/ZillaBootstrapFactoryTest.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/ZillaBootstrapFactoryTest.java index 1e6ce62bc3..b5fae85ad8 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/ZillaBootstrapFactoryTest.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/ZillaBootstrapFactoryTest.java @@ -18,9 +18,10 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.kaazing.k3po.driver.internal.netty.bootstrap.BootstrapFactory; -import org.kaazing.k3po.driver.internal.netty.bootstrap.ClientBootstrap; -import org.kaazing.k3po.driver.internal.netty.bootstrap.ServerBootstrap; + +import io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.BootstrapFactory; +import io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.ClientBootstrap; +import io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.ServerBootstrap; public class ZillaBootstrapFactoryTest { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/ZillaChannelAddressFactoryTest.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/ZillaChannelAddressFactoryTest.java index 3b376fc6e5..32fb73b32d 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/ZillaChannelAddressFactoryTest.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/ZillaChannelAddressFactoryTest.java @@ -15,16 +15,17 @@ */ package io.aklivity.zilla.runtime.engine.test.internal.k3po.ext; +import static io.aklivity.k3po.runtime.driver.internal.netty.channel.ChannelAddressFactory.newChannelAddressFactory; import static org.junit.Assert.assertNotNull; -import static org.kaazing.k3po.driver.internal.netty.channel.ChannelAddressFactory.newChannelAddressFactory; import java.net.URI; import java.util.LinkedHashMap; import java.util.Map; import org.junit.Test; -import org.kaazing.k3po.driver.internal.netty.channel.ChannelAddress; -import org.kaazing.k3po.driver.internal.netty.channel.ChannelAddressFactory; + +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ChannelAddress; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ChannelAddressFactory; public class ZillaChannelAddressFactoryTest { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/DefaultZillaChannelConfig.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/DefaultZillaChannelConfig.java index 4724da6644..a51a7053db 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/DefaultZillaChannelConfig.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/DefaultZillaChannelConfig.java @@ -36,7 +36,7 @@ import java.util.Objects; -import org.kaazing.k3po.driver.internal.netty.bootstrap.channel.DefaultChannelConfig; +import io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.channel.DefaultChannelConfig; public class DefaultZillaChannelConfig extends DefaultChannelConfig implements ZillaChannelConfig { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/DefaultZillaServerChannelConfig.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/DefaultZillaServerChannelConfig.java index 7bfefbd95e..3c924bdead 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/DefaultZillaServerChannelConfig.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/DefaultZillaServerChannelConfig.java @@ -35,7 +35,7 @@ import java.util.Objects; -import org.kaazing.k3po.driver.internal.netty.bootstrap.channel.DefaultServerChannelConfig; +import io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.channel.DefaultServerChannelConfig; public class DefaultZillaServerChannelConfig extends DefaultServerChannelConfig implements ZillaServerChannelConfig { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaBehaviorSystem.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaBehaviorSystem.java index f525593c12..ff6aa37042 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaBehaviorSystem.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaBehaviorSystem.java @@ -44,47 +44,47 @@ import java.util.function.Function; import org.jboss.netty.channel.ChannelHandler; -import org.kaazing.k3po.driver.internal.behavior.BehaviorSystemSpi; -import org.kaazing.k3po.driver.internal.behavior.ReadAdviseFactory; -import org.kaazing.k3po.driver.internal.behavior.ReadAdvisedFactory; -import org.kaazing.k3po.driver.internal.behavior.ReadConfigFactory; -import org.kaazing.k3po.driver.internal.behavior.ReadOptionFactory; -import org.kaazing.k3po.driver.internal.behavior.WriteAdviseFactory; -import org.kaazing.k3po.driver.internal.behavior.WriteAdvisedFactory; -import org.kaazing.k3po.driver.internal.behavior.WriteConfigFactory; -import org.kaazing.k3po.driver.internal.behavior.WriteOptionFactory; -import org.kaazing.k3po.driver.internal.behavior.handler.codec.ChannelDecoder; -import org.kaazing.k3po.driver.internal.behavior.handler.codec.ChannelEncoder; -import org.kaazing.k3po.driver.internal.behavior.handler.codec.MessageDecoder; -import org.kaazing.k3po.driver.internal.behavior.handler.codec.MessageEncoder; -import org.kaazing.k3po.driver.internal.behavior.handler.command.ReadAdviseHandler; -import org.kaazing.k3po.driver.internal.behavior.handler.command.WriteAdviseHandler; -import org.kaazing.k3po.driver.internal.behavior.handler.command.WriteConfigHandler; -import org.kaazing.k3po.driver.internal.behavior.handler.event.ReadAdvisedHandler; -import org.kaazing.k3po.driver.internal.behavior.handler.event.WriteAdvisedHandler; -import org.kaazing.k3po.driver.internal.behavior.visitor.GenerateConfigurationVisitor.State; -import org.kaazing.k3po.lang.internal.RegionInfo; -import org.kaazing.k3po.lang.internal.ast.AstReadAdviseNode; -import org.kaazing.k3po.lang.internal.ast.AstReadAdvisedNode; -import org.kaazing.k3po.lang.internal.ast.AstReadConfigNode; -import org.kaazing.k3po.lang.internal.ast.AstReadOptionNode; -import org.kaazing.k3po.lang.internal.ast.AstWriteAdviseNode; -import org.kaazing.k3po.lang.internal.ast.AstWriteAdvisedNode; -import org.kaazing.k3po.lang.internal.ast.AstWriteConfigNode; -import org.kaazing.k3po.lang.internal.ast.AstWriteOptionNode; -import org.kaazing.k3po.lang.internal.ast.matcher.AstValueMatcher; -import org.kaazing.k3po.lang.internal.ast.value.AstExpressionValue; -import org.kaazing.k3po.lang.internal.ast.value.AstLiteralByteValue; -import org.kaazing.k3po.lang.internal.ast.value.AstLiteralBytesValue; -import org.kaazing.k3po.lang.internal.ast.value.AstLiteralIntegerValue; -import org.kaazing.k3po.lang.internal.ast.value.AstLiteralLongValue; -import org.kaazing.k3po.lang.internal.ast.value.AstLiteralShortValue; -import org.kaazing.k3po.lang.internal.ast.value.AstLiteralTextValue; -import org.kaazing.k3po.lang.internal.ast.value.AstLiteralURIValue; -import org.kaazing.k3po.lang.internal.ast.value.AstValue; -import org.kaazing.k3po.lang.types.StructuredTypeInfo; -import org.kaazing.k3po.lang.types.TypeInfo; +import io.aklivity.k3po.runtime.driver.internal.behavior.BehaviorSystemSpi; +import io.aklivity.k3po.runtime.driver.internal.behavior.ReadAdviseFactory; +import io.aklivity.k3po.runtime.driver.internal.behavior.ReadAdvisedFactory; +import io.aklivity.k3po.runtime.driver.internal.behavior.ReadConfigFactory; +import io.aklivity.k3po.runtime.driver.internal.behavior.ReadOptionFactory; +import io.aklivity.k3po.runtime.driver.internal.behavior.WriteAdviseFactory; +import io.aklivity.k3po.runtime.driver.internal.behavior.WriteAdvisedFactory; +import io.aklivity.k3po.runtime.driver.internal.behavior.WriteConfigFactory; +import io.aklivity.k3po.runtime.driver.internal.behavior.WriteOptionFactory; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.codec.ChannelDecoder; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.codec.ChannelEncoder; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.codec.MessageDecoder; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.codec.MessageEncoder; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.command.ReadAdviseHandler; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.command.WriteAdviseHandler; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.command.WriteConfigHandler; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.event.ReadAdvisedHandler; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.event.WriteAdvisedHandler; +import io.aklivity.k3po.runtime.driver.internal.behavior.visitor.GenerateConfigurationVisitor.State; +import io.aklivity.k3po.runtime.lang.internal.RegionInfo; +import io.aklivity.k3po.runtime.lang.internal.ast.AstReadAdviseNode; +import io.aklivity.k3po.runtime.lang.internal.ast.AstReadAdvisedNode; +import io.aklivity.k3po.runtime.lang.internal.ast.AstReadConfigNode; +import io.aklivity.k3po.runtime.lang.internal.ast.AstReadOptionNode; +import io.aklivity.k3po.runtime.lang.internal.ast.AstWriteAdviseNode; +import io.aklivity.k3po.runtime.lang.internal.ast.AstWriteAdvisedNode; +import io.aklivity.k3po.runtime.lang.internal.ast.AstWriteConfigNode; +import io.aklivity.k3po.runtime.lang.internal.ast.AstWriteOptionNode; +import io.aklivity.k3po.runtime.lang.internal.ast.matcher.AstValueMatcher; +import io.aklivity.k3po.runtime.lang.internal.ast.value.AstExpressionValue; +import io.aklivity.k3po.runtime.lang.internal.ast.value.AstLiteralByteValue; +import io.aklivity.k3po.runtime.lang.internal.ast.value.AstLiteralBytesValue; +import io.aklivity.k3po.runtime.lang.internal.ast.value.AstLiteralIntegerValue; +import io.aklivity.k3po.runtime.lang.internal.ast.value.AstLiteralLongValue; +import io.aklivity.k3po.runtime.lang.internal.ast.value.AstLiteralShortValue; +import io.aklivity.k3po.runtime.lang.internal.ast.value.AstLiteralTextValue; +import io.aklivity.k3po.runtime.lang.internal.ast.value.AstLiteralURIValue; +import io.aklivity.k3po.runtime.lang.internal.ast.value.AstValue; +import io.aklivity.k3po.runtime.lang.types.StructuredTypeInfo; +import io.aklivity.k3po.runtime.lang.types.TypeInfo; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.handler.ReadAbortExtHandler; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.handler.ReadAckOptionHandler; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.handler.ReadBeginExtHandler; diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaBootstrapFactory.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaBootstrapFactory.java index d4419438e7..326545acc0 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaBootstrapFactory.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaBootstrapFactory.java @@ -16,10 +16,10 @@ package io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior; import org.jboss.netty.channel.ChannelFactory; -import org.kaazing.k3po.driver.internal.netty.bootstrap.BootstrapFactorySpi; -import org.kaazing.k3po.driver.internal.netty.bootstrap.ClientBootstrap; -import org.kaazing.k3po.driver.internal.netty.bootstrap.ServerBootstrap; +import io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.BootstrapFactorySpi; +import io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.ClientBootstrap; +import io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.ServerBootstrap; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.ZillaExtConfiguration; public class ZillaBootstrapFactory extends BootstrapFactorySpi diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannel.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannel.java index 8416d4a8af..1e6caec9d2 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannel.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannel.java @@ -30,9 +30,9 @@ import org.jboss.netty.channel.ChannelSink; import org.jboss.netty.channel.Channels; import org.jboss.netty.channel.MessageEvent; -import org.kaazing.k3po.driver.internal.netty.bootstrap.channel.AbstractChannel; -import org.kaazing.k3po.driver.internal.netty.channel.ChannelAddress; +import io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.channel.AbstractChannel; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ChannelAddress; import io.aklivity.zilla.runtime.engine.internal.budget.DefaultBudgetCreditor; import io.aklivity.zilla.runtime.engine.internal.budget.DefaultBudgetDebitor; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.types.stream.Capability; diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannelAddress.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannelAddress.java index cb53b75432..dcae2e4271 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannelAddress.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannelAddress.java @@ -19,7 +19,7 @@ import java.net.URI; -import org.kaazing.k3po.driver.internal.netty.channel.ChannelAddress; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ChannelAddress; public final class ZillaChannelAddress extends ChannelAddress { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannelAddressFactory.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannelAddressFactory.java index 8badcf6604..f87d748f20 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannelAddressFactory.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannelAddressFactory.java @@ -34,9 +34,10 @@ import java.util.Map; import org.jboss.netty.channel.ChannelException; -import org.kaazing.k3po.driver.internal.netty.channel.ChannelAddress; -import org.kaazing.k3po.driver.internal.netty.channel.ChannelAddressFactorySpi; -import org.kaazing.k3po.lang.types.TypeInfo; + +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ChannelAddress; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ChannelAddressFactorySpi; +import io.aklivity.k3po.runtime.lang.types.TypeInfo; public class ZillaChannelAddressFactory extends ChannelAddressFactorySpi { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannelConfig.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannelConfig.java index 1cdaa52a35..5c62e9ce09 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannelConfig.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChannelConfig.java @@ -15,7 +15,7 @@ */ package io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior; -import org.kaazing.k3po.driver.internal.netty.bootstrap.channel.ChannelConfig; +import io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.channel.ChannelConfig; public interface ZillaChannelConfig extends ChannelConfig { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChildChannelSink.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChildChannelSink.java index ad32d5866e..2a622d5f89 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChildChannelSink.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaChildChannelSink.java @@ -19,13 +19,14 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelStateEvent; import org.jboss.netty.channel.MessageEvent; -import org.kaazing.k3po.driver.internal.netty.bootstrap.channel.AbstractChannelSink; -import org.kaazing.k3po.driver.internal.netty.channel.FlushEvent; -import org.kaazing.k3po.driver.internal.netty.channel.ReadAbortEvent; -import org.kaazing.k3po.driver.internal.netty.channel.ReadAdviseEvent; -import org.kaazing.k3po.driver.internal.netty.channel.ShutdownOutputEvent; -import org.kaazing.k3po.driver.internal.netty.channel.WriteAbortEvent; -import org.kaazing.k3po.driver.internal.netty.channel.WriteAdviseEvent; + +import io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.channel.AbstractChannelSink; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.FlushEvent; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ReadAbortEvent; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ReadAdviseEvent; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ShutdownOutputEvent; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.WriteAbortEvent; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.WriteAdviseEvent; public class ZillaChildChannelSink extends AbstractChannelSink { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaClientChannel.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaClientChannel.java index 85ff823ec0..b9ba5a33e4 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaClientChannel.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaClientChannel.java @@ -20,7 +20,8 @@ import org.jboss.netty.channel.ChannelFactory; import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelSink; -import org.kaazing.k3po.driver.internal.netty.channel.ChannelAddress; + +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ChannelAddress; public final class ZillaClientChannel extends ZillaChannel { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaClientChannelSink.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaClientChannelSink.java index b5a6ceb7a8..95f373e8ed 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaClientChannelSink.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaClientChannelSink.java @@ -19,13 +19,14 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelStateEvent; import org.jboss.netty.channel.MessageEvent; -import org.kaazing.k3po.driver.internal.netty.bootstrap.channel.AbstractChannelSink; -import org.kaazing.k3po.driver.internal.netty.channel.FlushEvent; -import org.kaazing.k3po.driver.internal.netty.channel.ReadAbortEvent; -import org.kaazing.k3po.driver.internal.netty.channel.ReadAdviseEvent; -import org.kaazing.k3po.driver.internal.netty.channel.ShutdownOutputEvent; -import org.kaazing.k3po.driver.internal.netty.channel.WriteAbortEvent; -import org.kaazing.k3po.driver.internal.netty.channel.WriteAdviseEvent; + +import io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.channel.AbstractChannelSink; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.FlushEvent; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ReadAbortEvent; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ReadAdviseEvent; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ShutdownOutputEvent; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.WriteAbortEvent; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.WriteAdviseEvent; public class ZillaClientChannelSink extends AbstractChannelSink { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaPartition.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaPartition.java index 8ff4988344..f0f1fa9bf8 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaPartition.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaPartition.java @@ -36,8 +36,8 @@ import org.jboss.netty.channel.ChannelFuture; import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelPipelineFactory; -import org.kaazing.k3po.driver.internal.behavior.handler.RejectedHandler; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.RejectedHandler; import io.aklivity.zilla.runtime.engine.internal.budget.DefaultBudgetCreditor; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.layout.StreamsLayout; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.types.OctetsFW; diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaServerChannel.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaServerChannel.java index c9f1638910..1a02a82d6c 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaServerChannel.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaServerChannel.java @@ -21,7 +21,8 @@ import org.jboss.netty.channel.ChannelFactory; import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelSink; -import org.kaazing.k3po.driver.internal.netty.bootstrap.channel.AbstractServerChannel; + +import io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.channel.AbstractServerChannel; public final class ZillaServerChannel extends AbstractServerChannel { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaServerChannelSink.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaServerChannelSink.java index 64c52a5cfd..20992a0b0e 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaServerChannelSink.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaServerChannelSink.java @@ -18,7 +18,8 @@ import org.jboss.netty.channel.ChannelFuture; import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelStateEvent; -import org.kaazing.k3po.driver.internal.netty.bootstrap.channel.AbstractServerChannelSink; + +import io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.channel.AbstractServerChannelSink; public class ZillaServerChannelSink extends AbstractServerChannelSink { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaStreamFactory.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaStreamFactory.java index cc26a2396c..10c9603728 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaStreamFactory.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaStreamFactory.java @@ -15,6 +15,9 @@ */ package io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior; +import static io.aklivity.k3po.runtime.driver.internal.netty.channel.Channels.fireInputAborted; +import static io.aklivity.k3po.runtime.driver.internal.netty.channel.Channels.fireInputAdvised; +import static io.aklivity.k3po.runtime.driver.internal.netty.channel.Channels.fireInputShutdown; import static io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.NullChannelBuffer.NULL_BUFFER; import static io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.ZillaExtensionKind.ABORT; import static io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.ZillaExtensionKind.BEGIN; @@ -28,9 +31,6 @@ import static org.jboss.netty.channel.Channels.fireChannelUnbound; import static org.jboss.netty.channel.Channels.fireExceptionCaught; import static org.jboss.netty.channel.Channels.fireMessageReceived; -import static org.kaazing.k3po.driver.internal.netty.channel.Channels.fireInputAborted; -import static org.kaazing.k3po.driver.internal.netty.channel.Channels.fireInputAdvised; -import static org.kaazing.k3po.driver.internal.netty.channel.Channels.fireInputShutdown; import java.util.function.LongConsumer; import java.util.function.LongFunction; diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaTarget.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaTarget.java index e3e357b5b9..bfd996bc9f 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaTarget.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/ZillaTarget.java @@ -15,6 +15,10 @@ */ package io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior; +import static io.aklivity.k3po.runtime.driver.internal.netty.channel.Channels.fireFlushed; +import static io.aklivity.k3po.runtime.driver.internal.netty.channel.Channels.fireOutputAborted; +import static io.aklivity.k3po.runtime.driver.internal.netty.channel.Channels.fireOutputAdvised; +import static io.aklivity.k3po.runtime.driver.internal.netty.channel.Channels.fireOutputShutdown; import static io.aklivity.zilla.runtime.engine.internal.stream.BudgetId.budgetMask; import static io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.NullChannelBuffer.NULL_BUFFER; import static io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.ZillaExtensionKind.ABORT; @@ -38,10 +42,6 @@ import static org.jboss.netty.channel.Channels.fireWriteComplete; import static org.jboss.netty.channel.Channels.future; import static org.jboss.netty.channel.Channels.succeededFuture; -import static org.kaazing.k3po.driver.internal.netty.channel.Channels.fireFlushed; -import static org.kaazing.k3po.driver.internal.netty.channel.Channels.fireOutputAborted; -import static org.kaazing.k3po.driver.internal.netty.channel.Channels.fireOutputAdvised; -import static org.kaazing.k3po.driver.internal.netty.channel.Channels.fireOutputShutdown; import java.nio.file.Path; import java.util.Deque; @@ -60,8 +60,8 @@ import org.jboss.netty.channel.ChannelFutureListener; import org.jboss.netty.channel.DownstreamMessageEvent; import org.jboss.netty.channel.MessageEvent; -import org.kaazing.k3po.driver.internal.netty.channel.CompositeChannelFuture; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.CompositeChannelFuture; import io.aklivity.zilla.runtime.engine.internal.budget.DefaultBudgetCreditor; import io.aklivity.zilla.runtime.engine.internal.budget.DefaultBudgetDebitor; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.layout.Layout; diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/AbstractReadExtHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/AbstractReadExtHandler.java index 1376132f3a..7d389f08bd 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/AbstractReadExtHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/AbstractReadExtHandler.java @@ -23,8 +23,9 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelFuture; import org.jboss.netty.channel.ChannelHandlerContext; -import org.kaazing.k3po.driver.internal.behavior.handler.codec.ChannelDecoder; -import org.kaazing.k3po.driver.internal.behavior.handler.event.AbstractEventHandler; + +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.codec.ChannelDecoder; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.event.AbstractEventHandler; public abstract class AbstractReadExtHandler extends AbstractEventHandler { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadAbortExtHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadAbortExtHandler.java index 6ac37ab36c..d49251cca0 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadAbortExtHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadAbortExtHandler.java @@ -18,8 +18,9 @@ import java.util.EnumSet; import org.jboss.netty.channel.ChannelHandlerContext; -import org.kaazing.k3po.driver.internal.behavior.handler.codec.ChannelDecoder; -import org.kaazing.k3po.driver.internal.netty.channel.ReadAbortEvent; + +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.codec.ChannelDecoder; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ReadAbortEvent; public class ReadAbortExtHandler extends AbstractReadExtHandler { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadAckOptionHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadAckOptionHandler.java index b4842bb5a3..1039cd8691 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadAckOptionHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadAckOptionHandler.java @@ -19,8 +19,8 @@ import org.jboss.netty.channel.ChannelFuture; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.Channels; -import org.kaazing.k3po.driver.internal.behavior.handler.command.AbstractCommandHandler; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.command.AbstractCommandHandler; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.ZillaChannel; public class ReadAckOptionHandler extends AbstractCommandHandler diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadBeginExtHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadBeginExtHandler.java index fcba809632..0e085af013 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadBeginExtHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadBeginExtHandler.java @@ -15,17 +15,17 @@ */ package io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.handler; +import static io.aklivity.k3po.runtime.driver.internal.behavior.handler.event.AbstractEventHandler.ChannelEventKind.BOUND; +import static io.aklivity.k3po.runtime.driver.internal.behavior.handler.event.AbstractEventHandler.ChannelEventKind.CONNECTED; +import static io.aklivity.k3po.runtime.driver.internal.behavior.handler.event.AbstractEventHandler.ChannelEventKind.INTEREST_OPS; import static io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.ZillaTransmission.HALF_DUPLEX; -import static org.kaazing.k3po.driver.internal.behavior.handler.event.AbstractEventHandler.ChannelEventKind.BOUND; -import static org.kaazing.k3po.driver.internal.behavior.handler.event.AbstractEventHandler.ChannelEventKind.CONNECTED; -import static org.kaazing.k3po.driver.internal.behavior.handler.event.AbstractEventHandler.ChannelEventKind.INTEREST_OPS; import java.util.EnumSet; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.ChannelStateEvent; -import org.kaazing.k3po.driver.internal.behavior.handler.codec.ChannelDecoder; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.codec.ChannelDecoder; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.ZillaChannel; public class ReadBeginExtHandler extends AbstractReadExtHandler diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadDataExtHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadDataExtHandler.java index 2d0d7d2311..a16de6ef1d 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadDataExtHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadDataExtHandler.java @@ -19,7 +19,8 @@ import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.MessageEvent; -import org.kaazing.k3po.driver.internal.behavior.handler.codec.ChannelDecoder; + +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.codec.ChannelDecoder; public class ReadDataExtHandler extends AbstractReadExtHandler { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadEmptyDataHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadEmptyDataHandler.java index 698e0f3649..21c1571791 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadEmptyDataHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadEmptyDataHandler.java @@ -22,7 +22,8 @@ import org.jboss.netty.channel.ChannelFuture; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.MessageEvent; -import org.kaazing.k3po.driver.internal.behavior.handler.event.AbstractEventHandler; + +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.event.AbstractEventHandler; public class ReadEmptyDataHandler extends AbstractEventHandler { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadEndExtHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadEndExtHandler.java index 682ef934ac..51ef6e983a 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadEndExtHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadEndExtHandler.java @@ -18,8 +18,9 @@ import java.util.EnumSet; import org.jboss.netty.channel.ChannelHandlerContext; -import org.kaazing.k3po.driver.internal.behavior.handler.codec.ChannelDecoder; -import org.kaazing.k3po.driver.internal.netty.channel.ShutdownInputEvent; + +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.codec.ChannelDecoder; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.ShutdownInputEvent; public class ReadEndExtHandler extends AbstractReadExtHandler { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadFlagsOptionHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadFlagsOptionHandler.java index 0b1ce5f69a..fad26825cc 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadFlagsOptionHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadFlagsOptionHandler.java @@ -20,9 +20,9 @@ import org.jboss.netty.channel.ChannelFuture; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.MessageEvent; -import org.kaazing.k3po.driver.internal.behavior.ScriptProgressException; -import org.kaazing.k3po.driver.internal.behavior.handler.event.AbstractEventHandler; +import io.aklivity.k3po.runtime.driver.internal.behavior.ScriptProgressException; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.event.AbstractEventHandler; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.ZillaChannel; public class ReadFlagsOptionHandler extends AbstractEventHandler diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadNullDataHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadNullDataHandler.java index 98fc568711..3072ad7f96 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadNullDataHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ReadNullDataHandler.java @@ -22,7 +22,8 @@ import org.jboss.netty.channel.ChannelFuture; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.MessageEvent; -import org.kaazing.k3po.driver.internal.behavior.handler.event.AbstractEventHandler; + +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.event.AbstractEventHandler; public class ReadNullDataHandler extends AbstractEventHandler { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/WriteAbortedExtHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/WriteAbortedExtHandler.java index 3813692156..525a9886fb 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/WriteAbortedExtHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/WriteAbortedExtHandler.java @@ -18,8 +18,9 @@ import java.util.EnumSet; import org.jboss.netty.channel.ChannelHandlerContext; -import org.kaazing.k3po.driver.internal.behavior.handler.codec.ChannelDecoder; -import org.kaazing.k3po.driver.internal.netty.channel.WriteAbortEvent; + +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.codec.ChannelDecoder; +import io.aklivity.k3po.runtime.driver.internal.netty.channel.WriteAbortEvent; public class WriteAbortedExtHandler extends AbstractReadExtHandler { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/WriteEmptyDataHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/WriteEmptyDataHandler.java index 9363006f50..9436200368 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/WriteEmptyDataHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/WriteEmptyDataHandler.java @@ -19,7 +19,8 @@ import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.ChannelHandlerContext; -import org.kaazing.k3po.driver.internal.behavior.handler.command.AbstractCommandHandler; + +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.command.AbstractCommandHandler; public class WriteEmptyDataHandler extends AbstractCommandHandler { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/WriteFlagsOptionHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/WriteFlagsOptionHandler.java index d10ea692db..b2ca2041c6 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/WriteFlagsOptionHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/WriteFlagsOptionHandler.java @@ -16,8 +16,8 @@ package io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.handler; import org.jboss.netty.channel.ChannelHandlerContext; -import org.kaazing.k3po.driver.internal.behavior.handler.command.AbstractCommandHandler; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.command.AbstractCommandHandler; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.ZillaChannel; public class WriteFlagsOptionHandler extends AbstractCommandHandler diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ZillaExtensionDecoder.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ZillaExtensionDecoder.java index ecef4cf6c7..c1ca2de7e3 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ZillaExtensionDecoder.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ZillaExtensionDecoder.java @@ -23,10 +23,10 @@ import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; -import org.kaazing.k3po.driver.internal.behavior.handler.codec.ChannelDecoder; -import org.kaazing.k3po.driver.internal.behavior.handler.codec.MessageDecoder; -import org.kaazing.k3po.lang.types.StructuredTypeInfo; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.codec.ChannelDecoder; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.codec.MessageDecoder; +import io.aklivity.k3po.runtime.lang.types.StructuredTypeInfo; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.ZillaChannel; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.ZillaExtensionKind; diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ZillaExtensionEncoder.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ZillaExtensionEncoder.java index 4ea406f9ac..ca01de6552 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ZillaExtensionEncoder.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior/handler/ZillaExtensionEncoder.java @@ -21,10 +21,10 @@ import org.jboss.netty.buffer.ChannelBufferFactory; import org.jboss.netty.channel.Channel; -import org.kaazing.k3po.driver.internal.behavior.handler.codec.ChannelEncoder; -import org.kaazing.k3po.driver.internal.behavior.handler.codec.MessageEncoder; -import org.kaazing.k3po.lang.types.StructuredTypeInfo; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.codec.ChannelEncoder; +import io.aklivity.k3po.runtime.driver.internal.behavior.handler.codec.MessageEncoder; +import io.aklivity.k3po.runtime.lang.types.StructuredTypeInfo; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.ZillaChannel; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.ZillaChannelConfig; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.ZillaExtensionKind; diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/el/Functions.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/el/Functions.java index bf07a31756..8df146e9a9 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/el/Functions.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/el/Functions.java @@ -19,9 +19,8 @@ import java.nio.file.Path; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; - +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.ZillaExtConfiguration; import io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.behavior.LabelManager; diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/el/FunctionsTest.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/el/FunctionsTest.java index cdeaaf47a9..a112762a53 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/el/FunctionsTest.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/el/FunctionsTest.java @@ -15,16 +15,17 @@ */ package io.aklivity.zilla.runtime.engine.test.internal.k3po.ext.el; +import static io.aklivity.k3po.runtime.lang.internal.el.ExpressionFactoryUtils.newExpressionFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.instanceOf; import static org.junit.Assert.assertNotEquals; -import static org.kaazing.k3po.lang.internal.el.ExpressionFactoryUtils.newExpressionFactory; import javax.el.ExpressionFactory; import javax.el.ValueExpression; import org.junit.Test; -import org.kaazing.k3po.lang.internal.el.ExpressionContext; + +import io.aklivity.k3po.runtime.lang.internal.el.ExpressionContext; public final class FunctionsTest { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/types/ZillaTypeSystem.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/types/ZillaTypeSystem.java index e3c5556390..53589433b0 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/types/ZillaTypeSystem.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/types/ZillaTypeSystem.java @@ -22,9 +22,9 @@ import java.util.LinkedHashSet; import java.util.Set; -import org.kaazing.k3po.lang.types.StructuredTypeInfo; -import org.kaazing.k3po.lang.types.TypeInfo; -import org.kaazing.k3po.lang.types.TypeSystemSpi; +import io.aklivity.k3po.runtime.lang.types.StructuredTypeInfo; +import io.aklivity.k3po.runtime.lang.types.TypeInfo; +import io.aklivity.k3po.runtime.lang.types.TypeSystemSpi; public final class ZillaTypeSystem implements TypeSystemSpi { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/model/TestConverterHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/model/TestConverterHandler.java index 7fb260ee91..81356b14b1 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/model/TestConverterHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/model/TestConverterHandler.java @@ -15,24 +15,35 @@ */ package io.aklivity.zilla.runtime.engine.test.internal.model; +import java.util.HashMap; +import java.util.Map; import java.util.function.LongFunction; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.agrona.DirectBuffer; import io.aklivity.zilla.runtime.engine.catalog.CatalogHandler; import io.aklivity.zilla.runtime.engine.config.CatalogedConfig; import io.aklivity.zilla.runtime.engine.config.SchemaConfig; +import io.aklivity.zilla.runtime.engine.internal.types.OctetsFW; +import io.aklivity.zilla.runtime.engine.internal.types.String16FW; import io.aklivity.zilla.runtime.engine.model.ConverterHandler; import io.aklivity.zilla.runtime.engine.model.function.ValueConsumer; import io.aklivity.zilla.runtime.engine.test.internal.model.config.TestModelConfig; public class TestConverterHandler implements ConverterHandler { + private static final String PATH = "^\\$\\.([A-Za-z_][A-Za-z0-9_]*)$"; + private static final Pattern PATH_PATTERN = Pattern.compile(PATH); + private final int length; private final int schemaId; private final boolean read; private final CatalogHandler handler; private final SchemaConfig schema; + private final Map extracted; + private final Matcher matcher; public TestConverterHandler( TestModelConfig config, @@ -46,6 +57,18 @@ public TestConverterHandler( schema = cataloged != null ? cataloged.schemas.get(0) : null; schemaId = schema != null ? schema.id : 0; this.handler = cataloged != null ? supplyCatalog.apply(cataloged.id) : null; + this.extracted = new HashMap<>(); + this.matcher = PATH_PATTERN.matcher(""); + } + + @Override + public void extract( + String path) + { + if (matcher.reset(path).matches()) + { + extracted.put(matcher.group(1), new OctetsFW().wrap(new String16FW("12345").value(), 0, 5)); + } } @Override @@ -54,7 +77,7 @@ public int padding( int index, int length) { - return handler.encodePadding(); + return handler.encodePadding(length); } @Override @@ -73,5 +96,32 @@ public int convert( } return valid ? length : -1; } + + @Override + public int extractedLength( + String path) + { + OctetsFW value = null; + if (matcher.reset(path).matches()) + { + value = extracted.get(matcher.group(1)); + } + return value != null ? value.sizeof() : 0; + } + + @Override + public void extracted( + String path, + FieldVisitor visitor) + { + if (matcher.reset(path).matches()) + { + OctetsFW value = extracted.get(matcher.group(1)); + if (value != null && value.sizeof() != 0) + { + visitor.visit(value.buffer(), value.offset(), value.sizeof()); + } + } + } } diff --git a/runtime/engine/src/test/resources/FileSystemHelper.btm b/runtime/engine/src/test/resources/FileSystemHelper.btm new file mode 100644 index 0000000000..4801e4e132 --- /dev/null +++ b/runtime/engine/src/test/resources/FileSystemHelper.btm @@ -0,0 +1,6 @@ +RULE watcher service failed +CLASS ^java.nio.file.FileSystem +METHOD newWatchService +IF TRUE +DO throw new java.io.IOException("[failed]") +ENDRULE diff --git a/runtime/engine/src/test/resources/META-INF/services/org.kaazing.k3po.driver.internal.behavior.BehaviorSystemSpi b/runtime/engine/src/test/resources/META-INF/services/io.aklivity.k3po.runtime.driver.internal.behavior.BehaviorSystemSpi similarity index 100% rename from runtime/engine/src/test/resources/META-INF/services/org.kaazing.k3po.driver.internal.behavior.BehaviorSystemSpi rename to runtime/engine/src/test/resources/META-INF/services/io.aklivity.k3po.runtime.driver.internal.behavior.BehaviorSystemSpi diff --git a/runtime/engine/src/test/resources/META-INF/services/org.kaazing.k3po.driver.internal.netty.bootstrap.BootstrapFactorySpi b/runtime/engine/src/test/resources/META-INF/services/io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.BootstrapFactorySpi similarity index 100% rename from runtime/engine/src/test/resources/META-INF/services/org.kaazing.k3po.driver.internal.netty.bootstrap.BootstrapFactorySpi rename to runtime/engine/src/test/resources/META-INF/services/io.aklivity.k3po.runtime.driver.internal.netty.bootstrap.BootstrapFactorySpi diff --git a/runtime/engine/src/test/resources/META-INF/services/org.kaazing.k3po.driver.internal.netty.channel.ChannelAddressFactorySpi b/runtime/engine/src/test/resources/META-INF/services/io.aklivity.k3po.runtime.driver.internal.netty.channel.ChannelAddressFactorySpi similarity index 100% rename from runtime/engine/src/test/resources/META-INF/services/org.kaazing.k3po.driver.internal.netty.channel.ChannelAddressFactorySpi rename to runtime/engine/src/test/resources/META-INF/services/io.aklivity.k3po.runtime.driver.internal.netty.channel.ChannelAddressFactorySpi diff --git a/runtime/engine/src/test/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/runtime/engine/src/test/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from runtime/engine/src/test/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to runtime/engine/src/test/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/runtime/engine/src/test/resources/META-INF/services/org.kaazing.k3po.lang.types.TypeSystemSpi b/runtime/engine/src/test/resources/META-INF/services/io.aklivity.k3po.runtime.lang.types.TypeSystemSpi similarity index 100% rename from runtime/engine/src/test/resources/META-INF/services/org.kaazing.k3po.lang.types.TypeSystemSpi rename to runtime/engine/src/test/resources/META-INF/services/io.aklivity.k3po.runtime.lang.types.TypeSystemSpi diff --git a/runtime/exporter-otlp/pom.xml b/runtime/exporter-otlp/pom.xml index 30efac8e19..c9c71fc39b 100644 --- a/runtime/exporter-otlp/pom.xml +++ b/runtime/exporter-otlp/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.90 0 @@ -76,13 +74,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -208,7 +206,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java b/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java index 38da490ef9..63cc4349e8 100644 --- a/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java +++ b/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java @@ -76,10 +76,11 @@ private void handleEvent( eventJson.add(TIME_UNIX_NANO, nanos); eventJson.add(OBSERVED_TIME_UNIX_NANO, nanos); String qname = context.supplyQName(event.namespacedId()); + String eventName = context.supplyEventName(event.id()); String extension = formatter.format(msgTypeId, buffer, index, length); - addBody(qname, extension); eventAttributesJson = Json.createArrayBuilder(); - addStringAttribute("event.name", context.supplyLocalName(event.id())); + addStringAttribute("event.name", eventName); + addBody(qname, extension); eventJson.add(ATTRIBUTES, eventAttributesJson); eventsJson.add(eventJson); } diff --git a/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/OtlpMetricsSerializer.java b/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/OtlpMetricsSerializer.java index 307b8200ab..d7b8ce1d00 100644 --- a/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/OtlpMetricsSerializer.java +++ b/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/OtlpMetricsSerializer.java @@ -15,7 +15,6 @@ package io.aklivity.zilla.runtime.exporter.otlp.internal.serializer; import static io.aklivity.zilla.runtime.engine.metrics.Metric.Kind.COUNTER; -import static io.aklivity.zilla.runtime.engine.metrics.Metric.Unit.COUNT; import java.util.Arrays; import java.util.LinkedList; @@ -62,6 +61,7 @@ public class OtlpMetricsSerializer KindConfig.SERVER, SERVER_METRIC_NAMES, KindConfig.CLIENT, CLIENT_METRIC_NAMES ); + private static final String MILLISECONDS = "milliseconds"; private final List records; private final List attributes; @@ -129,11 +129,22 @@ else if (metric.getClass().equals(HistogramRecord.class)) private JsonObject serializeScalar( ScalarRecord record) { - JsonObject dataPoint = Json.createObjectBuilder() - .add("asInt", record.valueReader().getAsLong()) + JsonObjectBuilder dataPointBuilder = Json.createObjectBuilder(); + String unit = descriptor.unit(record.metric()); + if (MILLISECONDS.equals(unit)) + { + dataPointBuilder + .add("asDouble", record.millisecondsValueReader().getAsDouble()); + } + else + { + dataPointBuilder + .add("asInt", record.valueReader().getAsLong()); + } + dataPointBuilder .add("timeUnixNano", now()) - .add("attributes", attributes(record)) - .build(); + .add("attributes", attributes(record)); + JsonObject dataPoint = dataPointBuilder.build(); JsonArray dataPoints = Json.createArrayBuilder() .add(dataPoint) .build(); @@ -209,14 +220,17 @@ private JsonObject serializeHistogram( Arrays.stream(record.bucketLimits()).limit(record.buckets() - 1).forEach(explicitBounds::add); // The number of elements in bucket_counts must be by one greater than the number of elements in explicit_bounds. JsonArrayBuilder bucketCounts = Json.createArrayBuilder(); - Arrays.stream(record.bucketValues()).forEach(bucketCounts::add); + String unit = descriptor.unit(record.metric()); + long[] bucketValues = MILLISECONDS.equals(unit) ? record.millisecondBucketValues() : record.bucketValues(); + Arrays.stream(bucketValues).forEach(bucketCounts::add); + long[] stats = MILLISECONDS.equals(unit) ? record.millisecondStats() : record.stats(); JsonObject dataPoint = Json.createObjectBuilder() .add("timeUnixNano", now()) .add("attributes", attributes(record)) - .add("min", record.stats()[0]) - .add("max", record.stats()[1]) - .add("sum", record.stats()[2]) - .add("count", record.stats()[3]) + .add("min", stats[0]) + .add("max", stats[1]) + .add("sum", stats[2]) + .add("count", stats[3]) .add("explicitBounds", explicitBounds) .add("bucketCounts", bucketCounts) .build(); @@ -229,7 +243,7 @@ private JsonObject serializeHistogram( return Json.createObjectBuilder() .add("name", descriptor.nameByBinding(record.metric(), record.bindingId())) .add("description", descriptor.description(record.metric())) - .add("unit", descriptor.unit(record.metric())) + .add("unit", unit) .add("histogram", histogramData) .build(); } @@ -324,7 +338,12 @@ public String unit( if (result == null) { Metric.Unit unit = resolveMetric.apply(internalName).unit(); - result = unit == COUNT ? "" : unit.toString().toLowerCase(); + result = switch (unit) + { + case COUNT -> ""; + case NANOSECONDS -> MILLISECONDS; // we are converting nanoseconds values to milliseconds + default -> unit.toString().toLowerCase(); + }; units.put(internalName, result); } return result; diff --git a/runtime/exporter-otlp/src/test/java/io/aklivity/zilla/runtime/exporter/otlp/internal/EventIT.java b/runtime/exporter-otlp/src/test/java/io/aklivity/zilla/runtime/exporter/otlp/internal/EventIT.java index efa6b44ea0..6c28b88b3e 100644 --- a/runtime/exporter-otlp/src/test/java/io/aklivity/zilla/runtime/exporter/otlp/internal/EventIT.java +++ b/runtime/exporter-otlp/src/test/java/io/aklivity/zilla/runtime/exporter/otlp/internal/EventIT.java @@ -23,10 +23,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/exporter-otlp/src/test/java/io/aklivity/zilla/runtime/exporter/otlp/internal/MetricsIT.java b/runtime/exporter-otlp/src/test/java/io/aklivity/zilla/runtime/exporter/otlp/internal/MetricsIT.java index fb37740e28..97be5d45e2 100644 --- a/runtime/exporter-otlp/src/test/java/io/aklivity/zilla/runtime/exporter/otlp/internal/MetricsIT.java +++ b/runtime/exporter-otlp/src/test/java/io/aklivity/zilla/runtime/exporter/otlp/internal/MetricsIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.namespace.NamespacedId; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/exporter-prometheus/pom.xml b/runtime/exporter-prometheus/pom.xml index 80423ac80b..2025c36207 100644 --- a/runtime/exporter-prometheus/pom.xml +++ b/runtime/exporter-prometheus/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.90 0 @@ -76,13 +74,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -182,7 +180,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/exporter-prometheus/src/main/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/PrometheusExporterHandler.java b/runtime/exporter-prometheus/src/main/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/PrometheusExporterHandler.java index f69d67c470..d9fedec258 100644 --- a/runtime/exporter-prometheus/src/main/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/PrometheusExporterHandler.java +++ b/runtime/exporter-prometheus/src/main/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/PrometheusExporterHandler.java @@ -70,7 +70,8 @@ public void start() MetricsReader metrics = new MetricsReader(collector, context::supplyLocalName); List records = metrics.records(); PrometheusMetricDescriptor descriptor = new PrometheusMetricDescriptor(context::resolveMetric); - printer = new PrometheusMetricsPrinter(records, descriptor::kind, descriptor::name, descriptor::description); + printer = new PrometheusMetricsPrinter(records, descriptor::kind, descriptor::name, descriptor::description, + descriptor::milliseconds); for (PrometheusEndpointConfig endpoint : endpoints) { diff --git a/runtime/exporter-prometheus/src/main/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/printer/PrometheusMetricDescriptor.java b/runtime/exporter-prometheus/src/main/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/printer/PrometheusMetricDescriptor.java index f19679e056..08518fd507 100644 --- a/runtime/exporter-prometheus/src/main/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/printer/PrometheusMetricDescriptor.java +++ b/runtime/exporter-prometheus/src/main/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/printer/PrometheusMetricDescriptor.java @@ -72,7 +72,8 @@ private String externalName( } else if (metric.unit() == NANOSECONDS) { - result += "_nanoseconds"; + // we are converting nanoseconds values to milliseconds + result += "_milliseconds"; } if (metric.kind() == COUNTER) { @@ -81,6 +82,14 @@ else if (metric.unit() == NANOSECONDS) return result; } + public boolean milliseconds( + String internalName) + { + // we are converting nanoseconds values to milliseconds + Metric metric = metricResolver.apply(internalName); + return metric.unit() == NANOSECONDS; + } + public String description( String internalName) { diff --git a/runtime/exporter-prometheus/src/main/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/printer/PrometheusMetricsPrinter.java b/runtime/exporter-prometheus/src/main/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/printer/PrometheusMetricsPrinter.java index bf97baf31b..04d4a7e566 100644 --- a/runtime/exporter-prometheus/src/main/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/printer/PrometheusMetricsPrinter.java +++ b/runtime/exporter-prometheus/src/main/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/printer/PrometheusMetricsPrinter.java @@ -28,17 +28,20 @@ public class PrometheusMetricsPrinter private final Function supplyKind; private final Function supplyName; private final Function supplyDescription; + private final Function supplyMilliseconds; public PrometheusMetricsPrinter( List records, Function supplyKind, Function supplyName, - Function supplyDescription) + Function supplyDescription, + Function supplyMilliseconds) { this.records = records; this.supplyKind = supplyKind; this.supplyName = supplyName; this.supplyDescription = supplyDescription; + this.supplyMilliseconds = supplyMilliseconds; } public void print( @@ -73,12 +76,20 @@ private String formatScalar( String kind = supplyKind.apply(record.metric()); String extName = supplyName.apply(record.metric()); String description = supplyDescription.apply(record.metric()); + boolean milliseconds = supplyMilliseconds.apply(record.metric()); String format = "# HELP %s %s\n" + "# TYPE %s %s\n" + "%s{namespace=\"%s\",binding=\"%s\"} %d"; - return String.format(format, extName, description, extName, kind, extName, - record.namespace(), record.binding(), record.valueReader().getAsLong()); + String msFormat = + "# HELP %s %s\n" + + "# TYPE %s %s\n" + + "%s{namespace=\"%s\",binding=\"%s\"} %f"; + return milliseconds ? + String.format(msFormat, extName, description, extName, kind, extName, + record.namespace(), record.binding(), record.millisecondsValueReader().getAsDouble()) : + String.format(format, extName, description, extName, kind, extName, + record.namespace(), record.binding(), record.valueReader().getAsLong()); } private String formatHistogram( @@ -89,14 +100,15 @@ private String formatHistogram( String kind = supplyKind.apply(record.metric()); String extName = supplyName.apply(record.metric()); String description = supplyDescription.apply(record.metric()); - long sum = record.stats()[2]; - long count = record.stats()[3]; + boolean milliseconds = supplyMilliseconds.apply(record.metric()); + long sum = milliseconds ? record.millisecondStats()[2] : record.stats()[2]; + long count = milliseconds ? record.millisecondStats()[3] : record.stats()[3]; sb.append(String.format("# HELP %s %s\n# TYPE %s %s\n", extName, description, extName, kind)); long cumulativeValue = 0; for (int i = 0; i < record.buckets(); i++) { String limit = i == record.buckets() - 1 ? "+Inf" : String.valueOf(record.bucketLimits()[i]); - cumulativeValue += record.bucketValues()[i]; + cumulativeValue += milliseconds ? record.millisecondBucketValues()[i] : record.bucketValues()[i]; sb.append(String.format("%s_bucket{le=\"%s\",namespace=\"%s\",binding=\"%s\"} %d\n", extName, limit, record.namespace(), record.binding(), cumulativeValue)); } diff --git a/runtime/exporter-prometheus/src/test/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/printer/PrometheusMetricsPrinterTest.java b/runtime/exporter-prometheus/src/test/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/printer/PrometheusMetricsPrinterTest.java index 6222e8b506..a15f4cfd4d 100644 --- a/runtime/exporter-prometheus/src/test/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/printer/PrometheusMetricsPrinterTest.java +++ b/runtime/exporter-prometheus/src/test/java/io/aklivity/zilla/runtime/exporter/prometheus/internal/printer/PrometheusMetricsPrinterTest.java @@ -89,7 +89,79 @@ public void shouldWorkInGenericCase() throws Exception when(descriptor.description("histogram1")).thenReturn("description for histogram1"); PrometheusMetricsPrinter printer = new PrometheusMetricsPrinter(metricRecords, descriptor::kind, descriptor::name, - descriptor::description); + descriptor::description, descriptor::milliseconds); + ByteArrayOutputStream os = new ByteArrayOutputStream(); + PrintStream out = new PrintStream(os); + + // WHEN + printer.print(out); + + // THEN + assertThat(os.toString("UTF8"), equalTo(expectedOutput)); + } + + @Test + public void shouldWorkWithMilliseconds() throws Exception + { + String expectedOutput = + "# HELP counter1_total description for counter1\n" + + "# TYPE counter1_total counter\n" + + "counter1_total{namespace=\"ns1\",binding=\"binding1\"} 42.000000\n" + + "\n" + + "# HELP gauge1 description for gauge1\n" + + "# TYPE gauge1 gauge\n" + + "gauge1{namespace=\"ns1\",binding=\"binding1\"} 77.000000\n" + + "\n" + + "# HELP histogram1 description for histogram1\n" + + "# TYPE histogram1 histogram\n" + + "histogram1_bucket{le=\"1\",namespace=\"ns1\",binding=\"binding1\"} 7\n" + + "histogram1_bucket{le=\"10\",namespace=\"ns1\",binding=\"binding1\"} 49\n" + + "histogram1_bucket{le=\"100\",namespace=\"ns1\",binding=\"binding1\"} 58\n" + + "histogram1_bucket{le=\"+Inf\",namespace=\"ns1\",binding=\"binding1\"} 59\n" + + "histogram1_sum{namespace=\"ns1\",binding=\"binding1\"} 2327\n" + + "histogram1_count{namespace=\"ns1\",binding=\"binding1\"} 59\n\n\n"; + + ScalarRecord counterRecord = mock(ScalarRecord.class); + when(counterRecord.namespace()).thenReturn("ns1"); + when(counterRecord.binding()).thenReturn("binding1"); + when(counterRecord.metric()).thenReturn("counter1"); + when(counterRecord.millisecondsValueReader()).thenReturn(() -> 42L); + + ScalarRecord gaugeRecord = mock(ScalarRecord.class); + when(gaugeRecord.namespace()).thenReturn("ns1"); + when(gaugeRecord.binding()).thenReturn("binding1"); + when(gaugeRecord.metric()).thenReturn("gauge1"); + when(gaugeRecord.millisecondsValueReader()).thenReturn(() -> 77L); + + HistogramRecord histogramRecord = mock(HistogramRecord.class); + when(histogramRecord.namespace()).thenReturn("ns1"); + when(histogramRecord.binding()).thenReturn("binding1"); + when(histogramRecord.metric()).thenReturn("histogram1"); + when(histogramRecord.buckets()).thenReturn(4); + when(histogramRecord.bucketLimits()).thenReturn(new long[]{1, 10, 100, 1000}); + when(histogramRecord.millisecondBucketValues()).thenReturn(new long[]{7, 42, 9, 1}); + when(histogramRecord.millisecondStats()).thenReturn(new long[]{1L, 1000L, 2327L, 59L, 39L}); // min, max, sum, cnt, avg + + List metricRecords = List.of(counterRecord, gaugeRecord, histogramRecord); + + PrometheusMetricDescriptor descriptor = mock(PrometheusMetricDescriptor.class); + when(descriptor.name("counter1")).thenReturn("counter1_total"); + when(descriptor.kind("counter1")).thenReturn("counter"); + when(descriptor.description("counter1")).thenReturn("description for counter1"); + when(descriptor.milliseconds("counter1")).thenReturn(true); + + when(descriptor.name("gauge1")).thenReturn("gauge1"); + when(descriptor.kind("gauge1")).thenReturn("gauge"); + when(descriptor.description("gauge1")).thenReturn("description for gauge1"); + when(descriptor.milliseconds("gauge1")).thenReturn(true); + + when(descriptor.name("histogram1")).thenReturn("histogram1"); + when(descriptor.kind("histogram1")).thenReturn("histogram"); + when(descriptor.description("histogram1")).thenReturn("description for histogram1"); + when(descriptor.milliseconds("histogram1")).thenReturn(true); + + PrometheusMetricsPrinter printer = new PrometheusMetricsPrinter(metricRecords, descriptor::kind, descriptor::name, + descriptor::description, descriptor::milliseconds); ByteArrayOutputStream os = new ByteArrayOutputStream(); PrintStream out = new PrintStream(os); @@ -105,7 +177,7 @@ public void shouldPrintEmpty() throws Exception { // GIVEN String expectedOutput = ""; - PrometheusMetricsPrinter printer = new PrometheusMetricsPrinter(List.of(), null, null, null); + PrometheusMetricsPrinter printer = new PrometheusMetricsPrinter(List.of(), null, null, null, null); ByteArrayOutputStream os = new ByteArrayOutputStream(); PrintStream out = new PrintStream(os); diff --git a/runtime/exporter-stdout/pom.xml b/runtime/exporter-stdout/pom.xml index 2020a94c5f..fd4bfd49f8 100644 --- a/runtime/exporter-stdout/pom.xml +++ b/runtime/exporter-stdout/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.90 0 @@ -76,13 +74,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -182,7 +180,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java index c7cdec617b..70658d3b58 100644 --- a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java +++ b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java @@ -64,6 +64,12 @@ public String supplyQName( return context.supplyQName(namespacedId); } + public String supplyEventName( + int eventId) + { + return context.supplyEventName(eventId); + } + public EventFormatter supplyEventFormatter() { return context.supplyEventFormatter(); diff --git a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java index 1a866e87c2..fd189390f4 100644 --- a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java +++ b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java @@ -29,7 +29,8 @@ public class StdoutEventsStream { - private static final String FORMAT = "%s [%s] %s%n"; // qname [timestamp] extension\n + // {zilla namespace}:{component name} [dd/MMM/yyyy:HH:mm:ss Z] {event name} {event body}\n + private static final String FORMAT = "%s [%s] %s %s%n"; private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("dd/MMM/yyyy:HH:mm:ss Z"); private final StdoutExporterContext context; @@ -50,7 +51,7 @@ public StdoutEventsStream( public int process() { - return readEvent.read(this::handleEvent, 1); + return readEvent.read(this::handleEvent, Integer.MAX_VALUE); } private void handleEvent( @@ -61,8 +62,9 @@ private void handleEvent( { final EventFW event = eventRO.wrap(buffer, index, index + length); String qname = context.supplyQName(event.namespacedId()); + String eventName = context.supplyEventName(event.id()); String extension = formatter.format(msgTypeId, buffer, index, length); - out.format(FORMAT, qname, asDateTime(event.timestamp()), extension); + out.format(FORMAT, qname, asDateTime(event.timestamp()), eventName, extension); } private static String asDateTime( diff --git a/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java b/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java index c5b019b33e..409fe43a62 100644 --- a/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java +++ b/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java @@ -25,9 +25,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; import io.aklivity.zilla.runtime.engine.test.annotation.Configure; @@ -35,8 +35,8 @@ public class EventIT { private final K3poRule k3po = new K3poRule() - .addScriptRoot("net", "io/aklivity/zilla/specs/engine/streams/network") - .addScriptRoot("app", "io/aklivity/zilla/specs/engine/streams/application"); + .addScriptRoot("net", "io/aklivity/zilla/runtime/exporter/stdout/streams/network") + .addScriptRoot("app", "io/aklivity/zilla/runtime/exporter/stdout/streams/application"); private final TestRule timeout = new DisableOnDebug(new Timeout(5, SECONDS)); @@ -50,19 +50,19 @@ public class EventIT private final StdoutOutputRule output = new StdoutOutputRule(); @Rule - public final TestRule chain = outerRule(output).around(engine).around(k3po).around(timeout); + public final TestRule chain = outerRule(engine).around(output).around(k3po).around(timeout); @Test @Configuration("server.event.yaml") @Specification({ - "${net}/handshake/client", - "${app}/handshake/server" + "${net}/client", + "${app}/server" }) @Configure(name = STDOUT_OUTPUT_NAME, value = "io.aklivity.zilla.runtime.exporter.stdout.internal.events.StdoutOutputRule.OUT") public void shouldLogEvents() throws Exception { k3po.finish(); - output.expect(Pattern.compile("test.net0 \\[[^\\]]+\\] test event message\n")); + output.expect(Pattern.compile("test.net0 \\[[^\\]]+\\] BINDING_TEST_CONNECTED test event message\n")); } } diff --git a/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/StdoutOutputRule.java b/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/StdoutOutputRule.java index be79fd3ba8..4e7de35903 100644 --- a/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/StdoutOutputRule.java +++ b/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/StdoutOutputRule.java @@ -20,6 +20,7 @@ import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.nio.charset.StandardCharsets; +import java.util.Objects; import java.util.regex.Pattern; import org.junit.rules.TestRule; @@ -38,7 +39,7 @@ public final class StdoutOutputRule implements TestRule OUT = new PrintStream(BOS); } - private Pattern expected; + private volatile Pattern expected; @Override public Statement apply( @@ -51,8 +52,19 @@ public Statement apply( public void evaluate() throws Throwable { BOS.reset(); + base.evaluate(); - assertThat(BOS.toString(StandardCharsets.UTF_8), matchesPattern(expected)); + + while (BOS.size() == 0) + { + OUT.flush(); + Thread.onSpinWait(); + } + + final Pattern expect = Objects.requireNonNull(expected); + final String actual = BOS.toString(StandardCharsets.UTF_8); + + assertThat(actual, matchesPattern(expect)); } }; } diff --git a/runtime/exporter-stdout/src/test/scripts/io/aklivity/zilla/runtime/exporter/stdout/streams/application/client.rpt b/runtime/exporter-stdout/src/test/scripts/io/aklivity/zilla/runtime/exporter/stdout/streams/application/client.rpt new file mode 100644 index 0000000000..445dda1429 --- /dev/null +++ b/runtime/exporter-stdout/src/test/scripts/io/aklivity/zilla/runtime/exporter/stdout/streams/application/client.rpt @@ -0,0 +1,22 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "zilla://streams/app0" + option zilla:transmission "duplex" + option zilla:window 8192 +connected + +write close +read closed diff --git a/runtime/exporter-stdout/src/test/scripts/io/aklivity/zilla/runtime/exporter/stdout/streams/application/server.rpt b/runtime/exporter-stdout/src/test/scripts/io/aklivity/zilla/runtime/exporter/stdout/streams/application/server.rpt new file mode 100644 index 0000000000..e472f78204 --- /dev/null +++ b/runtime/exporter-stdout/src/test/scripts/io/aklivity/zilla/runtime/exporter/stdout/streams/application/server.rpt @@ -0,0 +1,24 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "zilla://streams/app0" + option zilla:transmission "duplex" + option zilla:window 8192 + +accepted +connected + +read closed +write close diff --git a/runtime/exporter-stdout/src/test/scripts/io/aklivity/zilla/runtime/exporter/stdout/streams/network/client.rpt b/runtime/exporter-stdout/src/test/scripts/io/aklivity/zilla/runtime/exporter/stdout/streams/network/client.rpt new file mode 100644 index 0000000000..4f5b46e924 --- /dev/null +++ b/runtime/exporter-stdout/src/test/scripts/io/aklivity/zilla/runtime/exporter/stdout/streams/network/client.rpt @@ -0,0 +1,22 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "zilla://streams/net0" + option zilla:transmission "duplex" + option zilla:window 8192 +connected + +write close +read closed diff --git a/runtime/exporter-stdout/src/test/scripts/io/aklivity/zilla/runtime/exporter/stdout/streams/network/server.rpt b/runtime/exporter-stdout/src/test/scripts/io/aklivity/zilla/runtime/exporter/stdout/streams/network/server.rpt new file mode 100644 index 0000000000..aa09e92730 --- /dev/null +++ b/runtime/exporter-stdout/src/test/scripts/io/aklivity/zilla/runtime/exporter/stdout/streams/network/server.rpt @@ -0,0 +1,24 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "zilla://streams/net0" + option zilla:transmission "duplex" + option zilla:window 8192 + +accepted +connected + +read closed +write close diff --git a/incubator/catalog-filesystem/COPYRIGHT b/runtime/filesystem-http/COPYRIGHT similarity index 100% rename from incubator/catalog-filesystem/COPYRIGHT rename to runtime/filesystem-http/COPYRIGHT diff --git a/incubator/catalog-filesystem/LICENSE b/runtime/filesystem-http/LICENSE similarity index 100% rename from incubator/catalog-filesystem/LICENSE rename to runtime/filesystem-http/LICENSE diff --git a/runtime/filesystem-http/NOTICE b/runtime/filesystem-http/NOTICE new file mode 100644 index 0000000000..d5dee9ccfc --- /dev/null +++ b/runtime/filesystem-http/NOTICE @@ -0,0 +1,14 @@ +Licensed under the Aklivity Community License (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at + + https://www.aklivity.io/aklivity-community-license/ + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +WARRANTIES OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. + +This project includes: + agrona under The Apache License, Version 2.0 + diff --git a/incubator/catalog-filesystem.spec/NOTICE.template b/runtime/filesystem-http/NOTICE.template similarity index 100% rename from incubator/catalog-filesystem.spec/NOTICE.template rename to runtime/filesystem-http/NOTICE.template diff --git a/incubator/catalog-filesystem/mvnw b/runtime/filesystem-http/mvnw similarity index 100% rename from incubator/catalog-filesystem/mvnw rename to runtime/filesystem-http/mvnw diff --git a/incubator/catalog-filesystem/mvnw.cmd b/runtime/filesystem-http/mvnw.cmd similarity index 100% rename from incubator/catalog-filesystem/mvnw.cmd rename to runtime/filesystem-http/mvnw.cmd diff --git a/runtime/filesystem-http/pom.xml b/runtime/filesystem-http/pom.xml new file mode 100644 index 0000000000..f82bb3eda1 --- /dev/null +++ b/runtime/filesystem-http/pom.xml @@ -0,0 +1,205 @@ + + + + 4.0.0 + + io.aklivity.zilla + runtime + 0.9.83 + ../pom.xml + + + filesystem-http + zilla::runtime::filesystem-http + + + + Aklivity Community License Agreement + https://www.aklivity.io/aklivity-community-license/ + repo + + + + + 11 + 11 + 0.50 + 0 + + + + + ${project.groupId} + filesystem-http.spec + ${project.version} + provided + + + org.agrona + agrona + + + junit + junit + test + + + org.hamcrest + hamcrest + test + + + com.vtence.hamcrest + hamcrest-jpa + test + + + com.github.npathai + hamcrest-optional + test + + + org.mockito + mockito-core + test + + + io.aklivity.k3po + control-junit + test + + + io.aklivity.k3po + lang + test + + + org.openjdk.jmh + jmh-core + test + + + org.openjdk.jmh + jmh-generator-annprocess + test + + + + + + + org.jasig.maven + maven-notice-plugin + + + com.mycila + license-maven-plugin + + + maven-checkstyle-plugin + + + maven-dependency-plugin + + + unpack-test-resources + process-test-resources + + unpack + + + + + ${project.groupId} + filesystem-http.spec + + + ^\Qio/aklivity/zilla/specs/filesystem/http/\E + io/aklivity/zilla/runtime/filesystem/http/internal/ + + + + + + io/aklivity/zilla/specs/filesystem/http/application/**/*, + + ${project.build.directory}/test-classes + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + + org.moditect + moditect-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + io.aklivity.k3po + k3po-maven-plugin + + + org.apache.maven.plugins + maven-failsafe-plugin + + + org.jacoco + jacoco-maven-plugin + + + + BUNDLE + + + INSTRUCTION + COVEREDRATIO + ${jacoco.coverage.ratio} + + + CLASS + MISSEDCOUNT + ${jacoco.missed.count} + + + + + + + + io.gatling + maven-shade-plugin + + + + org.openjdk.jmh:jmh-core + net.sf.jopt-simple:jopt-simple + org.apache.commons:commons-math3 + commons-cli:commons-cli + com.github.biboudis:jmh-profilers + + + + + + + diff --git a/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpFileSystem.java b/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpFileSystem.java new file mode 100644 index 0000000000..8f274fd89d --- /dev/null +++ b/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpFileSystem.java @@ -0,0 +1,146 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.filesystem.http.internal; + +import static java.net.http.HttpClient.Redirect.NORMAL; +import static java.net.http.HttpClient.Version.HTTP_2; +import static java.util.Objects.requireNonNull; + +import java.net.URI; +import java.net.http.HttpClient; +import java.nio.file.FileStore; +import java.nio.file.FileSystem; +import java.nio.file.Path; +import java.nio.file.PathMatcher; +import java.nio.file.attribute.UserPrincipalLookupService; +import java.util.Map; +import java.util.Set; + +public final class HttpFileSystem extends FileSystem +{ + private static final String HTTP_PATH_SEPARATOR = "/"; + + private final HttpFileSystemProvider provider; + private final URI root; + private final HttpFileSystemConfiguration config; + private final HttpClient client; + + HttpFileSystem( + HttpFileSystemProvider provider, + URI root, + Map env) + { + this.provider = provider; + this.root = root; + this.config = new HttpFileSystemConfiguration(env); + this.client = HttpClient.newBuilder() + .version(HTTP_2) + .followRedirects(NORMAL) + .build(); + } + + @Override + public HttpFileSystemProvider provider() + { + return provider; + } + + @Override + public void close() + { + provider.closeFileSystem(root); + } + + @Override + public boolean isOpen() + { + return true; + } + + @Override + public boolean isReadOnly() + { + return true; + } + + @Override + public String getSeparator() + { + return HTTP_PATH_SEPARATOR; + } + + @Override + public Iterable getRootDirectories() + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public Iterable getFileStores() + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public Set supportedFileAttributeViews() + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public Path getPath( + String first, + String... more) + { + requireNonNull(first); + requireNonNull(more); + + String path = more.length > 0 + ? first + HTTP_PATH_SEPARATOR + String.join(HTTP_PATH_SEPARATOR, more) + : first; + + return getPath(URI.create(path)); + } + + public HttpPath getPath( + URI uri) + { + return new HttpPath(this, uri); + } + + @Override + public PathMatcher getPathMatcher( + String syntaxAndPattern) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public UserPrincipalLookupService getUserPrincipalLookupService() + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public HttpWatchService newWatchService() + { + return new HttpWatchService(config); + } + + HttpClient client() + { + return client; + } +} diff --git a/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpFileSystemConfiguration.java b/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpFileSystemConfiguration.java new file mode 100644 index 0000000000..c9757554db --- /dev/null +++ b/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpFileSystemConfiguration.java @@ -0,0 +1,40 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.filesystem.http.internal; + +import java.time.Duration; +import java.util.Map; +import java.util.Objects; + +public final class HttpFileSystemConfiguration +{ + public static final String POLL_INTERVAL_PROPERTY_NAME = "zilla.filesystem.http.poll.interval"; + + private static final Duration POLL_INTERVAL_PROPERTY_DEFAULT = Duration.parse("PT30S"); + + private final Map env; + + HttpFileSystemConfiguration( + Map env) + { + this.env = Objects.requireNonNull(env); + } + + public Duration pollInterval() + { + String value = env != null ? (String) env.get(POLL_INTERVAL_PROPERTY_NAME) : null; + return value != null ? Duration.parse(value) : POLL_INTERVAL_PROPERTY_DEFAULT; + } +} diff --git a/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpFileSystemProvider.java b/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpFileSystemProvider.java new file mode 100644 index 0000000000..14587c81f9 --- /dev/null +++ b/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpFileSystemProvider.java @@ -0,0 +1,329 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.filesystem.http.internal; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URI; +import java.nio.channels.AsynchronousFileChannel; +import java.nio.channels.FileChannel; +import java.nio.channels.SeekableByteChannel; +import java.nio.file.AccessMode; +import java.nio.file.CopyOption; +import java.nio.file.DirectoryStream; +import java.nio.file.FileStore; +import java.nio.file.FileSystem; +import java.nio.file.FileSystemAlreadyExistsException; +import java.nio.file.FileSystemNotFoundException; +import java.nio.file.LinkOption; +import java.nio.file.OpenOption; +import java.nio.file.Path; +import java.nio.file.attribute.BasicFileAttributes; +import java.nio.file.attribute.FileAttribute; +import java.nio.file.attribute.FileAttributeView; +import java.nio.file.spi.FileSystemProvider; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ExecutorService; + +public class HttpFileSystemProvider extends FileSystemProvider +{ + private final Map fileSystems = new ConcurrentHashMap<>(); + + @Override + public String getScheme() + { + return "http"; + } + + @Override + @SuppressWarnings("resource") + public FileSystem newFileSystem( + URI uri, + Map env) + { + checkURI(uri); + + URI rootURI = uri.resolve("/"); + return fileSystems.compute(rootURI, (u, fs) -> computeHttpFileSystem(u, fs, env)); + } + + @Override + public FileSystem getFileSystem( + URI uri) + { + checkURI(uri); + URI rootURI = uri.resolve("/"); + HttpFileSystem hfs = fileSystems.get(rootURI); + if (hfs == null) + { + throw new FileSystemNotFoundException(); + } + return hfs; + } + + @Override + public Path getPath( + URI uri) + { + checkURI(uri); + URI rootURI = uri.resolve("/"); + HttpFileSystem hfs = fileSystems.computeIfAbsent(rootURI, this::newHttpFileSystem); + return hfs.getPath(uri); + } + + @Override + public FileSystem newFileSystem( + Path path, + Map env) + { + return newFileSystem(path.toUri(), env); + } + + @Override + public InputStream newInputStream( + Path path, + OpenOption... options) + { + HttpPath httpPath = checkPath(path); + return new ByteArrayInputStream(httpPath.readBody()); + } + + @Override + public OutputStream newOutputStream( + Path path, + OpenOption... options) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public FileChannel newFileChannel( + Path path, + Set options, + FileAttribute... attrs) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public AsynchronousFileChannel newAsynchronousFileChannel( + Path path, + Set options, + ExecutorService executor, + FileAttribute... attrs) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public SeekableByteChannel newByteChannel( + Path path, + Set options, + FileAttribute... attrs) + { + HttpPath httpPath = checkPath(path); + return new ReadOnlyByteArrayChannel(httpPath.readBody()); + } + + @Override + public DirectoryStream newDirectoryStream( + Path dir, + DirectoryStream.Filter filter) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public void createDirectory( + Path dir, + FileAttribute... attrs) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public void createSymbolicLink( + Path link, + Path target, FileAttribute... attrs) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public void createLink( + Path link, + Path existing) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public void delete( + Path path) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public boolean deleteIfExists( + Path path) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public Path readSymbolicLink( + Path link) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public void copy( + Path source, + Path target, + CopyOption... options) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public void move( + Path source, + Path target, + CopyOption... options) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public boolean isSameFile( + Path path, + Path path2) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public boolean isHidden( + Path path) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public FileStore getFileStore( + Path path) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public void checkAccess( + Path path, + AccessMode... modes) + { + Objects.requireNonNull(path); + } + + @Override + public V getFileAttributeView( + Path path, + Class type, + LinkOption... options) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public A readAttributes( + Path path, + Class type, + LinkOption... options) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public Map readAttributes( + Path path, + String attributes, + LinkOption... options) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public void setAttribute( + Path path, + String attribute, + Object value, LinkOption... options) + { + throw new UnsupportedOperationException("not implemented"); + } + + void closeFileSystem( + URI uri) + { + fileSystems.remove(uri); + } + + private void checkURI( + URI uri) + { + if (!uri.getScheme().equalsIgnoreCase(getScheme())) + { + throw new IllegalArgumentException("URI does not match this provider"); + } + + if (uri.getPath() == null) + { + throw new IllegalArgumentException("Path component is undefined"); + } + } + + private HttpPath checkPath( + Path path) + { + if (!path.getFileSystem().provider().getScheme().equalsIgnoreCase(getScheme())) + { + throw new IllegalArgumentException("Scheme does not match this provider"); + } + return HttpPath.class.cast(path); + } + + private HttpFileSystem computeHttpFileSystem( + URI uri, + HttpFileSystem hfs, + Map env) + { + if (hfs != null) + { + throw new FileSystemAlreadyExistsException(); + } + + return new HttpFileSystem(this, uri, env); + } + + private HttpFileSystem newHttpFileSystem( + URI uri) + { + return new HttpFileSystem(this, uri, Map.of()); + } +} diff --git a/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpPath.java b/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpPath.java new file mode 100644 index 0000000000..bb6d54c838 --- /dev/null +++ b/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpPath.java @@ -0,0 +1,379 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.filesystem.http.internal; + +import static java.net.HttpURLConnection.HTTP_NOT_FOUND; +import static java.net.HttpURLConnection.HTTP_NOT_MODIFIED; +import static java.net.HttpURLConnection.HTTP_NO_CONTENT; +import static java.net.HttpURLConnection.HTTP_OK; +import static java.util.Objects.requireNonNull; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.net.http.HttpResponse.BodyHandlers; +import java.nio.file.LinkOption; +import java.nio.file.Path; +import java.nio.file.ProviderMismatchException; +import java.nio.file.WatchEvent; +import java.nio.file.WatchKey; +import java.nio.file.WatchService; +import java.util.Arrays; +import java.util.Iterator; +import java.util.Objects; + +public final class HttpPath implements Path +{ + private static final byte[] EMPTY_BODY = new byte[0]; + + private final HttpFileSystem fs; + private final URI location; + + private volatile byte[] body; + private volatile String etag; + + private volatile int changeCount; + private volatile int readCount; + + HttpPath( + HttpFileSystem fs, + URI location) + { + this.fs = Objects.requireNonNull(fs); + this.location = Objects.requireNonNull(location); + } + + @Override + public HttpFileSystem getFileSystem() + { + return fs; + } + + @Override + public boolean isAbsolute() + { + return true; + } + + @Override + public Path getRoot() + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public Path getFileName() + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public Path getParent() + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public int getNameCount() + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public Path getName( + int index) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public Path subpath( + int beginIndex, + int endIndex) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public boolean startsWith( + Path other) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public boolean startsWith( + String other) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public boolean endsWith( + Path other) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public boolean endsWith( + String other) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public Path normalize() + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public Path resolve( + Path other) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public Path resolve( + String other) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public Path resolveSibling( + Path other) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public Path resolveSibling( + String other) + { + return new HttpPath(fs, location.resolve(URI.create(other))); + } + + @Override + public Path relativize( + Path other) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public URI toUri() + { + return location; + } + + @Override + public Path toAbsolutePath() + { + return this; + } + + @Override + public Path toRealPath( + LinkOption... options) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public File toFile() + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public WatchKey register( + WatchService watcher, + WatchEvent.Kind... events) throws IOException + { + return register(watcher, events, new WatchEvent.Modifier[0]); + } + + @Override + public WatchKey register( + WatchService watcher, + WatchEvent.Kind[] events, + WatchEvent.Modifier... modifiers) + throws IOException + { + HttpWatchService httpWatcher = checkWatcher(watcher); + return httpWatcher.register(this, events, modifiers); + } + + @Override + public Iterator iterator() + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public int compareTo( + Path other) + { + HttpPath that = (HttpPath) other; + + return location.compareTo(that.location); + } + + @Override + public String toString() + { + return location.toString(); + } + + @Override + public boolean equals( + Object o) + { + if (this == o) + { + return true; + } + if (o == null || getClass() != o.getClass()) + { + return false; + } + + HttpPath path = (HttpPath) o; + return Objects.equals(location, path.location); + } + + @Override + public int hashCode() + { + return Objects.hashCode(location); + } + + byte[] readBody() + { + if (readCount == changeCount) + { + try + { + HttpClient client = fs.client(); + HttpRequest request = newReadRequest(); + HttpResponse response = client.send(request, BodyHandlers.ofByteArray()); + success(response); + } + catch (Exception ex) + { + failure(ex); + } + } + + readCount = changeCount; + + return body; + } + + void success( + HttpResponse response) + { + final int status = response.statusCode(); + + switch (status) + { + case HTTP_OK: + case HTTP_NO_CONTENT: + byte[] oldBody = body; + body = status == HTTP_NO_CONTENT ? EMPTY_BODY : response.body(); + etag = response.headers().firstValue("Etag").orElse(null); + if (body == null || + oldBody == null || + !Arrays.equals(body, oldBody)) + { + changeCount++; + } + break; + case HTTP_NOT_FOUND: + body = EMPTY_BODY; + etag = null; + changeCount++; + break; + case HTTP_NOT_MODIFIED: + break; + } + } + + Void failure( + Throwable ex) + { + body = HttpPath.EMPTY_BODY; + etag = null; + changeCount++; + return null; + } + + int changeCount() + { + return changeCount; + } + + boolean exists() + { + return body != null; + } + + private HttpRequest newReadRequest() + { + HttpRequest.Builder request = HttpRequest.newBuilder() + .GET() + .uri(location); + + if (etag != null && !etag.isEmpty()) + { + request = request.headers("If-None-Match", etag); + } + + return request.build(); + } + + HttpRequest newWatchRequest() + { + HttpRequest.Builder request = HttpRequest.newBuilder() + .GET() + .uri(location); + + if (etag != null) + { + request = request.headers("If-None-Match", etag, "Prefer", "wait=86400"); + } + + return request.build(); + } + + private HttpWatchService checkWatcher( + WatchService watcher) + { + requireNonNull(watcher); + + if (!(watcher instanceof HttpWatchService)) + { + throw new ProviderMismatchException(); + } + + return (HttpWatchService) watcher; + } +} diff --git a/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpWatchService.java b/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpWatchService.java new file mode 100644 index 0000000000..5c52e1cbde --- /dev/null +++ b/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpWatchService.java @@ -0,0 +1,394 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.filesystem.http.internal; + +import static java.lang.System.currentTimeMillis; +import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE; +import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE; +import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY; +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.agrona.LangUtil.rethrowUnchecked; + +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.net.http.HttpResponse.BodyHandlers; +import java.nio.file.ClosedWatchServiceException; +import java.nio.file.Path; +import java.nio.file.WatchEvent; +import java.nio.file.WatchKey; +import java.nio.file.WatchService; +import java.time.Duration; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentSkipListSet; +import java.util.concurrent.Executors; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +public final class HttpWatchService implements WatchService +{ + private final WatchKey closeKey = new HttpWatchKey(); + + private final Duration pollInterval; + private final Collection watchKeys; + private final BlockingQueue pendingKeys; + private final ScheduledExecutorService executor; + + private volatile boolean closed; + + HttpWatchService( + HttpFileSystemConfiguration config) + { + this.pollInterval = config.pollInterval(); + this.watchKeys = new ConcurrentSkipListSet<>(); + this.pendingKeys = new LinkedBlockingQueue<>(); + this.executor = Executors.newScheduledThreadPool(2); + } + + @Override + public void close() + { + watchKeys.forEach(HttpWatchKey::cancel); + watchKeys.clear(); + + closed = true; + pendingKeys.clear(); + pendingKeys.offer(closeKey); + + executor.shutdownNow(); + + try + { + executor.awaitTermination(5, TimeUnit.SECONDS); + } + catch (InterruptedException ex) + { + rethrowUnchecked(ex); + } + } + + @Override + public WatchKey poll() + { + checkOpen(); + WatchKey key = pendingKeys.poll(); + return key != closeKey ? key : null; + } + + @Override + public WatchKey poll( + long timeout, + TimeUnit unit) throws InterruptedException + { + checkOpen(); + WatchKey key = pendingKeys.poll(timeout, unit); + return key != closeKey ? key : null; + } + + @Override + public WatchKey take() throws InterruptedException + { + checkOpen(); + WatchKey key = pendingKeys.take(); + return key != closeKey ? key : null; + } + + HttpWatchKey register( + HttpPath path, + WatchEvent.Kind[] events, + WatchEvent.Modifier... modifiers) + { + checkEvents(events); + checkModifiers(modifiers); + + HttpWatchKey watchKey = new HttpWatchKey(this, path); + watchKeys.add(watchKey); + watchKey.watch(); + + return watchKey; + } + + private void checkOpen() + { + if (closed) + { + throw new ClosedWatchServiceException(); + } + } + + private void checkEvents( + WatchEvent.Kind[] events) + { + for (WatchEvent.Kind event : events) + { + if (!event.equals(ENTRY_CREATE) && + !event.equals(ENTRY_MODIFY) && + !event.equals(ENTRY_DELETE)) + { + throw new IllegalArgumentException(String.format("%s event kind not supported", event)); + } + } + } + + private void checkModifiers( + WatchEvent.Modifier[] modifiers) + { + if (modifiers.length > 0) + { + throw new IllegalArgumentException("Modifiers are not supported"); + } + } + + private void watchBody( + HttpWatchKey watchKey) + { + long elapsed = currentTimeMillis() - watchKey.lastWatchAt; + long delay = Math.max(SECONDS.toMillis(pollInterval.getSeconds()) - elapsed, 0L); + + executor.schedule(watchKey::watchBody, delay, MILLISECONDS); + } + + private void signalKey( + HttpWatchKey watchKey) + { + pendingKeys.offer(watchKey); + } + + private void cancelKey( + HttpWatchKey watchKey) + { + watchKeys.remove(watchKey); + } + + private static final class HttpWatchKey implements WatchKey, Comparable + { + private final HttpWatchService watcher; + private final HttpPath path; + + private List> watchEvents = Collections.synchronizedList(new LinkedList<>()); + + private volatile boolean valid; + private volatile CompletableFuture future; + private long lastWatchAt; + + private HttpWatchKey() + { + this.watcher = null; + this.path = null; + this.valid = false; + } + + private HttpWatchKey( + HttpWatchService watcher, + HttpPath path) + { + this.watcher = watcher; + this.path = path; + this.valid = true; + } + + @Override + public boolean isValid() + { + return valid; + } + + @Override + public List> pollEvents() + { + List> result = watchEvents; + watchEvents = Collections.synchronizedList(new LinkedList<>()); + return result; + } + + @Override + public boolean reset() + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public void cancel() + { + future.cancel(true); + watcher.cancelKey(this); + valid = false; + } + + @Override + public HttpPath watchable() + { + return path; + } + + @Override + public boolean equals( + Object o) + { + if (this == o) + { + return true; + } + if (o == null || getClass() != o.getClass()) + { + return false; + } + + HttpWatchKey that = (HttpWatchKey) o; + return Objects.equals(path, that.path); + } + + @Override + public int hashCode() + { + return Objects.hashCode(path); + } + + @Override + public int compareTo( + HttpWatchKey that) + { + return path.compareTo(that.path); + } + + private void watch() + { + if (valid) + { + watcher.watchBody(this); + } + } + + private void watchBody() + { + HttpClient client = path.getFileSystem().client(); + HttpRequest request = path.newWatchRequest(); + + this.lastWatchAt = currentTimeMillis(); + + this.future = client.sendAsync(request, BodyHandlers.ofByteArray()) + .thenAccept(this::success) + .exceptionally(this::failure); + } + + private void success( + HttpResponse response) + { + int changeCount = path.changeCount(); + boolean exists = path.exists(); + + path.success(response); + + if (path.changeCount() != changeCount) + { + if (exists == path.exists()) + { + signalEvent(ENTRY_MODIFY); + } + else if (exists) + { + signalEvent(ENTRY_DELETE); + } + else + { + signalEvent(ENTRY_CREATE); + } + + this.lastWatchAt = 0L; + } + + watcher.watchBody(this); + } + + private Void failure( + Throwable ex) + { + int changeCount = path.changeCount(); + boolean exists = path.exists(); + + path.failure(ex); + + if (path.changeCount() != changeCount) + { + if (exists == path.exists()) + { + signalEvent(ENTRY_MODIFY); + } + else if (exists) + { + signalEvent(ENTRY_DELETE); + } + else + { + signalEvent(ENTRY_CREATE); + } + } + + // (back off)? + watcher.watchBody(this); + + return null; + } + + private void signalEvent( + WatchEvent.Kind kind) + { + watchEvents.add(new HttpWatchEvent(kind, path)); + watcher.signalKey(this); + } + + private static class HttpWatchEvent implements WatchEvent + { + private final WatchEvent.Kind kind; + private final Path context; + private final int count; + + HttpWatchEvent( + WatchEvent.Kind type, + Path context) + { + this.kind = type; + this.context = context; + this.count = 1; + } + + @Override + public WatchEvent.Kind kind() + { + return kind; + } + + @Override + public Path context() + { + return context; + } + + @Override + public int count() + { + return count; + } + } + } +} diff --git a/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpsFileSystemProvider.java b/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpsFileSystemProvider.java new file mode 100644 index 0000000000..156d88ef35 --- /dev/null +++ b/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/HttpsFileSystemProvider.java @@ -0,0 +1,24 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.filesystem.http.internal; + +public class HttpsFileSystemProvider extends HttpFileSystemProvider +{ + @Override + public String getScheme() + { + return "https"; + } +} diff --git a/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/ReadOnlyByteArrayChannel.java b/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/ReadOnlyByteArrayChannel.java new file mode 100644 index 0000000000..b18bc64c1a --- /dev/null +++ b/runtime/filesystem-http/src/main/java/io/aklivity/zilla/runtime/filesystem/http/internal/ReadOnlyByteArrayChannel.java @@ -0,0 +1,115 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.filesystem.http.internal; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.SeekableByteChannel; + +final class ReadOnlyByteArrayChannel implements SeekableByteChannel +{ + private final byte[] data; + private int position; + private boolean closed; + + ReadOnlyByteArrayChannel( + byte[] data) + { + this.data = data; + this.position = 0; + this.closed = false; + } + + @Override + public int read( + ByteBuffer dst) throws IOException + { + ensureOpen(); + int bytesRead; + if (position >= data.length) + { + bytesRead = -1; + } + else + { + bytesRead = Math.min(dst.remaining(), data.length - position); + dst.put(data, position, bytesRead); + position += bytesRead; + } + return bytesRead; + } + + @Override + public int write( + ByteBuffer src) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public long position() throws IOException + { + ensureOpen(); + return position; + } + + @Override + public SeekableByteChannel position( + long newPosition) throws IOException + { + ensureOpen(); + if (newPosition < 0 || newPosition > data.length) + { + throw new IllegalArgumentException("Position out of bounds"); + } + this.position = (int) newPosition; + return this; + } + + @Override + public long size() throws IOException + { + ensureOpen(); + return data.length; + } + + @Override + public SeekableByteChannel truncate( + long size) + { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public boolean isOpen() + { + return !closed; + } + + @Override + public void close() + { + closed = true; + } + + private void ensureOpen() throws IOException + { + if (closed) + { + throw new ClosedChannelException(); + } + } +} diff --git a/runtime/filesystem-http/src/main/moditect/module-info.java b/runtime/filesystem-http/src/main/moditect/module-info.java new file mode 100644 index 0000000000..a953179fba --- /dev/null +++ b/runtime/filesystem-http/src/main/moditect/module-info.java @@ -0,0 +1,23 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +module io.aklivity.zilla.runtime.filesystem.http +{ + requires java.net.http; + requires org.agrona.core; + + provides java.nio.file.spi.FileSystemProvider with + io.aklivity.zilla.runtime.filesystem.http.internal.HttpFileSystemProvider, + io.aklivity.zilla.runtime.filesystem.http.internal.HttpsFileSystemProvider; +} diff --git a/runtime/filesystem-http/src/main/resources/META-INF/services/java.nio.file.spi.FileSystemProvider b/runtime/filesystem-http/src/main/resources/META-INF/services/java.nio.file.spi.FileSystemProvider new file mode 100644 index 0000000000..0801cb9df9 --- /dev/null +++ b/runtime/filesystem-http/src/main/resources/META-INF/services/java.nio.file.spi.FileSystemProvider @@ -0,0 +1,2 @@ +io.aklivity.zilla.runtime.filesystem.http.internal.HttpFileSystemProvider +io.aklivity.zilla.runtime.filesystem.http.internal.HttpsFileSystemProvider diff --git a/runtime/filesystem-http/src/test/java/io/aklivity/zilla/runtime/filesystem/http/HttpFileSystemIT.java b/runtime/filesystem-http/src/test/java/io/aklivity/zilla/runtime/filesystem/http/HttpFileSystemIT.java new file mode 100644 index 0000000000..6fef361311 --- /dev/null +++ b/runtime/filesystem-http/src/test/java/io/aklivity/zilla/runtime/filesystem/http/HttpFileSystemIT.java @@ -0,0 +1,296 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.filesystem.http; + +import static io.aklivity.zilla.runtime.filesystem.http.internal.HttpFileSystemConfiguration.POLL_INTERVAL_PROPERTY_NAME; +import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE; +import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; +import static org.junit.rules.RuleChain.outerRule; + +import java.io.InputStream; +import java.net.URI; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.WatchEvent; +import java.nio.file.WatchKey; +import java.nio.file.WatchService; +import java.util.List; +import java.util.Map; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.DisableOnDebug; +import org.junit.rules.TestRule; +import org.junit.rules.Timeout; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; + +public class HttpFileSystemIT +{ + private final K3poRule k3po = new K3poRule() + .addScriptRoot("app", "io/aklivity/zilla/specs/filesystem/http/application"); + + private final TestRule timeout = new DisableOnDebug(new Timeout(10, SECONDS)); + + @Rule + public final TestRule chain = outerRule(k3po).around(timeout); + + @Test + @Specification({ + "${app}/read.success/server", + }) + public void shouldReadString() throws Exception + { + // GIVEN + URI helloURI = URI.create("http://localhost:8080/hello.txt"); + try (FileSystem fs = FileSystems.newFileSystem(helloURI, Map.of())) + { + Path helloPath = fs.getPath(helloURI.toString()); + + // WHEN + k3po.start(); + String helloBody = Files.readString(helloPath); + k3po.finish(); + + // THEN + assertThat(helloBody, equalTo("Hello World!")); + } + } + + @Test + @Specification({ + "${app}/read.success.etag.not.modified/server", + }) + public void shouldReadStringEtagNotModified() throws Exception + { + // GIVEN + URI helloURI = URI.create("http://localhost:8080/hello.txt"); + try (FileSystem fs = FileSystems.newFileSystem(helloURI, Map.of())) + { + Path helloPath = fs.getPath(helloURI.toString()); + + // WHEN + k3po.start(); + String helloBody1 = Files.readString(helloPath); + String helloBody2 = Files.readString(helloPath); + k3po.finish(); + + // THEN + assertThat(helloBody1, equalTo("Hello World!")); + assertThat(helloBody2, equalTo("Hello World!")); + } + } + + @Test + @Specification({ + "${app}/read.success.etag.modified/server", + }) + public void shouldReadStringEtagModified() throws Exception + { + // GIVEN + URI helloURI = URI.create("http://localhost:8080/hello.txt"); + try (FileSystem fs = FileSystems.newFileSystem(helloURI, Map.of())) + { + Path helloPath = fs.getPath(helloURI.toString()); + + // WHEN + k3po.start(); + String helloBody1 = Files.readString(helloPath); + String helloBody2 = Files.readString(helloPath); + k3po.finish(); + + // THEN + assertThat(helloBody1, equalTo("Hello World!")); + assertThat(helloBody2, equalTo("Hello Universe!")); + } + } + + @Test + @Specification({ + "${app}/read.notfound/server", + }) + public void shouldReadStringNotFound() throws Exception + { + // GIVEN + URI notFoundURI = URI.create("http://localhost:8080/notfound.txt"); + try (FileSystem fs = FileSystems.newFileSystem(notFoundURI, Map.of())) + { + Path notFoundPath = fs.getPath(notFoundURI.toString()); + + // WHEN + k3po.start(); + String notFoundBody = Files.readString(notFoundPath); + k3po.finish(); + + // THEN + assertThat(notFoundBody, equalTo("")); + } + } + + @Test + @Specification({ + "${app}/read.notfound.success/server", + }) + public void shouldReadStringNotFoundSuccess() throws Exception + { + // GIVEN + URI helloURI = URI.create("http://localhost:8080/hello.txt"); + try (FileSystem fs = FileSystems.newFileSystem(helloURI, Map.of())) + { + Path helloPath = fs.getPath(helloURI.toString()); + + // WHEN + k3po.start(); + String helloBody1 = Files.readString(helloPath); + String helloBody2 = Files.readString(helloPath); + k3po.finish(); + + // THEN + assertThat(helloBody1, equalTo("")); + assertThat(helloBody2, equalTo("Hello World!")); + } + } + + @Test + @Specification({ + "${app}/read.success/server", + }) + public void shouldReadInputStream() throws Exception + { + // GIVEN + URI helloURI = URI.create("http://localhost:8080/hello.txt"); + try (FileSystem fs = FileSystems.newFileSystem(helloURI, Map.of())) + { + Path helloPath = fs.getPath(helloURI.toString()); + + // WHEN + k3po.start(); + InputStream helloIs = Files.newInputStream(helloPath); + String helloBody = new String(helloIs.readAllBytes()); + helloIs.close(); + k3po.finish(); + + // THEN + assertThat(helloBody, equalTo("Hello World!")); + } + } + + @Test + @Specification({ + "${app}/read.notfound/server", + }) + public void shouldReadInputStreamNotFound() throws Exception + { + // GIVEN + URI notFoundURI = URI.create("http://localhost:8080/notfound.txt"); + try (FileSystem fs = FileSystems.newFileSystem(notFoundURI, Map.of())) + { + Path notFoundPath = fs.getPath(notFoundURI.toString()); + + // WHEN + k3po.start(); + InputStream notFoundIs = Files.newInputStream(notFoundPath); + String notFoundBody = new String(notFoundIs.readAllBytes()); + notFoundIs.close(); + k3po.finish(); + + // THEN + assertThat(notFoundBody, equalTo("")); + } + } + + @Test + @Specification({ + "${app}/watch/server", + }) + public void shouldWatch() throws Exception + { + // GIVEN + URI uri = URI.create("http://localhost:8080/hello.txt"); + Map env = Map.of(POLL_INTERVAL_PROPERTY_NAME, "PT0S"); + try (FileSystem fs = FileSystems.newFileSystem(uri, env)) + { + Path path = fs.getPath(uri.toString()); + + try (WatchService watcher = fs.newWatchService()) + { + // WHEN + k3po.start(); + + k3po.notifyBarrier("REGISTERED"); + path.register(watcher); + + WatchKey key1 = watcher.take(); + List> events1 = key1.pollEvents(); + + k3po.notifyBarrier("MODIFIED"); + + WatchKey key2 = watcher.take(); + List> events2 = key2.pollEvents(); + + k3po.finish(); + + // THEN + assertThat(events1.size(), equalTo(1)); + assertThat(events1.get(0).kind(), equalTo(ENTRY_CREATE)); + assertThat(events1.get(0).context(), equalTo(path)); + assertThat(events2.size(), equalTo(1)); + assertThat(events2.get(0).kind(), equalTo(ENTRY_MODIFY)); + assertThat(events2.get(0).context(), equalTo(path)); + } + } + } + + @Test + @Specification({ + "${app}/watch.read/server", + }) + public void shouldWatchRead() throws Exception + { + // GIVEN + URI uri = URI.create("http://localhost:8080/hello.txt"); + Map env = Map.of(POLL_INTERVAL_PROPERTY_NAME, "PT0S"); + try (FileSystem fs = FileSystems.newFileSystem(uri, env)) + { + Path path = fs.getPath(uri.toString()); + + try (WatchService watcher = fs.newWatchService()) + { + // WHEN + k3po.start(); + + String body1 = Files.readString(path); + + path.register(watcher); + + watcher.take(); + + String body2 = Files.readString(path); + + k3po.finish(); + + // THEN + assertThat(body1, equalTo("Hello World!")); + assertThat(body2, equalTo("Hello Universe!")); + } + } + } +} diff --git a/runtime/filesystem-http/src/test/java/io/aklivity/zilla/runtime/filesystem/http/HttpFileSystemTest.java b/runtime/filesystem-http/src/test/java/io/aklivity/zilla/runtime/filesystem/http/HttpFileSystemTest.java new file mode 100644 index 0000000000..2682fafc56 --- /dev/null +++ b/runtime/filesystem-http/src/test/java/io/aklivity/zilla/runtime/filesystem/http/HttpFileSystemTest.java @@ -0,0 +1,89 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.filesystem.http; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; + +import java.net.URI; +import java.nio.file.Path; + +import org.junit.Test; + +public class HttpFileSystemTest +{ + @Test + public void testHttpPath() throws Exception + { + // GIVEN + String httpUrl = "http://localhost:4242/hello.txt"; + + // WHEN + Path path = Path.of(new URI(httpUrl)); + + // THEN + assertThat(path.getFileSystem().getClass().getSimpleName(), equalTo("HttpFileSystem")); + assertThat(path.getFileSystem().provider().getClass().getSimpleName(), equalTo("HttpFileSystemProvider")); + assertThat(path.getFileSystem().provider().getScheme(), equalTo("http")); + } + + @Test + public void testHttpsPath() throws Exception + { + // GIVEN + String httpsUrl = "https://localhost:4242/hello.txt"; + + // WHEN + Path path = Path.of(new URI(httpsUrl)); + + // THEN + assertThat(path.getFileSystem().getClass().getSimpleName(), equalTo("HttpFileSystem")); + assertThat(path.getFileSystem().provider().getClass().getSimpleName(), equalTo("HttpsFileSystemProvider")); + assertThat(path.getFileSystem().provider().getScheme(), equalTo("https")); + } + + @Test + public void testHttpSiblingString() throws Exception + { + // GIVEN + String httpUrl = "http://localhost:4242/greeting/hello.txt"; + Path path = Path.of(new URI(httpUrl)); + + // WHEN + Path sibling = path.resolveSibling("bye.txt"); + + // THEN + assertThat(sibling.getFileSystem().getClass().getSimpleName(), equalTo("HttpFileSystem")); + assertThat(sibling.getFileSystem().provider().getClass().getSimpleName(), equalTo("HttpFileSystemProvider")); + assertThat(sibling.toString(), equalTo("http://localhost:4242/greeting/bye.txt")); + } + + + @Test + public void testHttpsSiblingString() throws Exception + { + // GIVEN + String httpUrl = "https://localhost:4242/greeting/hello.txt"; + Path path = Path.of(new URI(httpUrl)); + + // WHEN + Path sibling = path.resolveSibling("bye.txt"); + + // THEN + assertThat(sibling.getFileSystem().getClass().getSimpleName(), equalTo("HttpFileSystem")); + assertThat(sibling.getFileSystem().provider().getClass().getSimpleName(), equalTo("HttpsFileSystemProvider")); + assertThat(sibling.toString(), equalTo("https://localhost:4242/greeting/bye.txt")); + } +} diff --git a/runtime/guard-jwt/pom.xml b/runtime/guard-jwt/pom.xml index f43fc5b8bd..4bd23c8a1b 100644 --- a/runtime/guard-jwt/pom.xml +++ b/runtime/guard-jwt/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,9 +24,7 @@ - 11 - 11 - 0.98 + 0.94 0 @@ -70,6 +68,11 @@ ${project.version} test + + ${project.groupId} + filesystem-http + test + junit junit @@ -86,13 +89,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -177,7 +180,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventContext.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventContext.java index d5c2ec1d04..a42847a34f 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventContext.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventContext.java @@ -52,13 +52,15 @@ public JwtEventContext( public void authorizationFailed( long traceId, long bindingId, - String identity) + String identity, + String reason) { JwtEventExFW extension = jwtEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) .authorizationFailed(e -> e .typeId(AUTHORIZATION_FAILED.value()) .identity(identity) + .reason(reason) ) .build(); EventFW event = eventRW diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java index 36282d3a48..32a1c11875 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java @@ -25,8 +25,6 @@ public final class JwtEventFormatter implements EventFormatterSpi { - private static final String AUTHORIZATION_FAILED_FORMAT = "AUTHORIZATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final JwtEventExFW jwtEventExRO = new JwtEventExFW(); @@ -49,17 +47,20 @@ public String format( case AUTHORIZATION_FAILED: { JwtAuthorizationFailedExFW ex = extension.authorizationFailed(); - result = String.format(AUTHORIZATION_FAILED_FORMAT, identity(ex.identity())); + result = String.format("JWT token authorization failed for identity (%s). %s", + asString(ex.identity()), + asString(ex.reason()) + ); break; } } return result; } - private static String identity( - StringFW identity) + private static String asString( + StringFW stringFW) { - int length = identity.length(); - return length <= 0 ? "-" : identity.asString(); + String s = stringFW.asString(); + return s == null ? "" : s; } } diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardContext.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardContext.java index 55c141be78..3c002ee908 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardContext.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardContext.java @@ -44,7 +44,7 @@ public JwtGuardHandler attach( GuardConfig guard) { JwtOptionsConfig options = (JwtOptionsConfig) guard.options; - JwtGuardHandler handler = new JwtGuardHandler(options, context, supplyAuthorizedId, guard.readURL); + JwtGuardHandler handler = new JwtGuardHandler(options, context, supplyAuthorizedId); handlersById.put(guard.id, handler); return handler; } diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java index d166b336c6..be90da20c5 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java @@ -16,6 +16,9 @@ import static org.agrona.LangUtil.rethrowUnchecked; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; import java.time.Duration; import java.time.Instant; import java.util.Arrays; @@ -26,7 +29,6 @@ import java.util.Objects; import java.util.Optional; import java.util.function.Consumer; -import java.util.function.Function; import java.util.function.LongSupplier; import jakarta.json.bind.Jsonb; @@ -65,8 +67,7 @@ public class JwtGuardHandler implements GuardHandler public JwtGuardHandler( JwtOptionsConfig options, EngineContext context, - LongSupplier supplyAuthorizedId, - Function readURL) + LongSupplier supplyAuthorizedId) { this.issuer = options.issuer; this.audience = options.audience; @@ -80,8 +81,8 @@ public JwtGuardHandler( Jsonb jsonb = JsonbBuilder.newBuilder() .withConfig(config) .build(); - - String keysText = readURL.apply(options.keysURL.get()); + Path keysPath = context.resolvePath(options.keysURL.get()); + String keysText = readKeys(keysPath); JwtKeySetConfig jwks = jsonb.fromJson(keysText, JwtKeySetConfig.class); keysConfig = jwks.keys; } @@ -128,6 +129,7 @@ public long reauthorize( { JwtSession session = null; String subject = null; + String reason = ""; authorize: try @@ -142,6 +144,7 @@ public long reauthorize( key == null || !Objects.equals(alg, key.getAlgorithm())) { + reason = "Invalid alg or key."; break authorize; } @@ -149,6 +152,7 @@ public long reauthorize( signature.setKey(key.getKey()); if (!signature.verifySignature()) { + reason = "Unable to verify key signature."; break authorize; } @@ -162,10 +166,15 @@ public long reauthorize( long now = Instant.now().toEpochMilli(); if (notBefore != null && now < notBefore.getValueInMillis() || - notAfter != null && now > notAfter.getValueInMillis() || - issuer == null || !issuer.equals(this.issuer) || + notAfter != null && now > notAfter.getValueInMillis()) + { + reason = "Token is expired."; + break authorize; + } + if (issuer == null || !issuer.equals(this.issuer) || audience == null || !audience.contains(this.audience)) { + reason = "Invalid issuer or audience."; break authorize; } @@ -191,11 +200,11 @@ public long reauthorize( } catch (JoseException | InvalidJwtException | MalformedClaimException ex) { - // not authorized + reason = ex.getMessage(); } if (session == null) { - event.authorizationFailed(traceId, bindingId, subject); + event.authorizationFailed(traceId, bindingId, subject, reason); } return session != null ? session.authorized : NOT_AUTHORIZED; } @@ -396,4 +405,21 @@ private void unshareIfNecessary() } } } + + private static String readKeys( + Path keysPath) + { + String content = null; + + try + { + content = Files.readString(keysPath); + } + catch (IOException ex) + { + rethrowUnchecked(ex); + } + + return content; + } } diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/config/JwtKeySetConfigAdapter.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/config/JwtKeySetConfigAdapter.java index d554efe2b4..e6b76f3bee 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/config/JwtKeySetConfigAdapter.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/config/JwtKeySetConfigAdapter.java @@ -14,8 +14,6 @@ */ package io.aklivity.zilla.runtime.guard.jwt.internal.config; -import static java.util.stream.Collectors.toList; - import java.util.List; import jakarta.json.Json; @@ -36,15 +34,20 @@ public final class JwtKeySetConfigAdapter implements JsonbAdapter keysConfig = keysObject - .getJsonArray(KEYS_NAME) - .stream() + List keysConfig = keysObject.containsKey(KEYS_NAME) + ? keysObject.getJsonArray(KEYS_NAME).stream() .map(JsonValue::asJsonObject) .map(keyAdapter::adaptFromJson) - .collect(toList()); + .toList() + : null; + return new JwtKeySetConfig(keysConfig); } } diff --git a/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/EventIT.java b/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/EventIT.java index b90241f39e..899ab2c79d 100644 --- a/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/EventIT.java +++ b/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/EventIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandlerTest.java b/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandlerTest.java index 90bd4add79..a19d95da95 100644 --- a/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandlerTest.java +++ b/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandlerTest.java @@ -31,7 +31,6 @@ import java.time.Clock; import java.time.Duration; import java.time.Instant; -import java.util.function.Function; import org.agrona.collections.MutableLong; import org.jose4j.jws.JsonWebSignature; @@ -46,8 +45,6 @@ public class JwtGuardHandlerTest { - private static final Function READ_KEYS_URL = url -> "{}"; - private EngineContext context; @Before @@ -69,7 +66,7 @@ public void shouldAuthorize() throws Exception .key(RFC7515_RS256_CONFIG) .challenge(challenge) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); Instant now = Instant.now(); @@ -102,7 +99,7 @@ public void shouldChallengeDuringChallengeWindow() throws Exception .key(RFC7515_RS256_CONFIG) .challenge(challenge) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); Instant now = Instant.now(); @@ -131,7 +128,7 @@ public void shouldNotChallengeDuringWindowWithoutSubject() throws Exception .key(RFC7515_RS256_CONFIG) .challenge(challenge) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); Instant now = Instant.now(); @@ -159,7 +156,7 @@ public void shouldNotChallengeBeforeChallengeWindow() throws Exception .key(RFC7515_RS256_CONFIG) .challenge(challenge) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); Instant now = Instant.now(); @@ -188,7 +185,7 @@ public void shouldNotChallengeAgainDuringChallengeWindow() throws Exception .key(RFC7515_RS256_CONFIG) .challenge(challenge) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); Instant now = Instant.now(); @@ -217,7 +214,7 @@ public void shouldNotAuthorizeWhenAlgorithmDiffers() throws Exception .audience("testAudience") .key(RFC7515_RS256_CONFIG) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); JwtClaims claims = new JwtClaims(); claims.setClaim("iss", "test issuer"); @@ -239,7 +236,7 @@ public void shouldNotAuthorizeWhenSignatureInvalid() throws Exception .audience("testAudience") .key(RFC7515_RS256_CONFIG) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); JwtClaims claims = new JwtClaims(); claims.setClaim("iss", "test issuer"); @@ -263,7 +260,7 @@ public void shouldNotAuthorizeWhenIssuerDiffers() throws Exception .audience("testAudience") .key(RFC7515_RS256_CONFIG) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); JwtClaims claims = new JwtClaims(); claims.setClaim("iss", "not test issuer"); @@ -285,7 +282,7 @@ public void shouldNotAuthorizeWhenAudienceDiffers() throws Exception .audience("testAudience") .key(RFC7515_RS256_CONFIG) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); JwtClaims claims = new JwtClaims(); claims.setClaim("iss", "test issuer"); @@ -307,7 +304,7 @@ public void shouldNotAuthorizeWhenExpired() throws Exception .audience("testAudience") .key(RFC7515_RS256_CONFIG) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); Instant now = Instant.now(); @@ -332,7 +329,7 @@ public void shouldNotAuthorizeWhenNotYetValid() throws Exception .audience("testAudience") .key(RFC7515_RS256_CONFIG) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); Instant now = Instant.now(); @@ -359,7 +356,7 @@ public void shouldNotVerifyAuthorizedWhenRolesInsufficient() throws Exception .key(RFC7515_RS256_CONFIG) .challenge(challenge) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); JwtClaims claims = new JwtClaims(); claims.setClaim("iss", "test issuer"); @@ -385,7 +382,7 @@ public void shouldReauthorizeWhenExpirationLater() throws Exception .key(RFC7515_RS256_CONFIG) .challenge(challenge) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); Instant now = Instant.now(); @@ -420,7 +417,7 @@ public void shouldReauthorizeWhenScopeBroader() throws Exception .key(RFC7515_RS256_CONFIG) .challenge(challenge) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); Instant now = Instant.now(); @@ -456,7 +453,7 @@ public void shouldNotReauthorizeWhenExpirationEarlier() throws Exception .key(RFC7515_RS256_CONFIG) .challenge(challenge) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); Instant now = Instant.now(); @@ -491,7 +488,7 @@ public void shouldNotReauthorizeWhenScopeNarrower() throws Exception .key(RFC7515_RS256_CONFIG) .challenge(challenge) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); Instant now = Instant.now(); @@ -528,7 +525,7 @@ public void shouldNotReauthorizeWhenSubjectDiffers() throws Exception .key(RFC7515_RS256_CONFIG) .challenge(challenge) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); Instant now = Instant.now(); @@ -565,7 +562,7 @@ public void shouldNotReauthorizeWhenContextDiffers() throws Exception .key(RFC7515_RS256_CONFIG) .challenge(challenge) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); Instant now = Instant.now(); @@ -601,7 +598,7 @@ public void shouldDeauthorize() throws Exception .key(RFC7515_RS256_CONFIG) .challenge(challenge) .build(); - JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement, READ_KEYS_URL); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); Instant now = Instant.now(); diff --git a/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardIT.java b/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardIT.java index c89f04281c..77457d8578 100644 --- a/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardIT.java +++ b/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardIT.java @@ -23,11 +23,16 @@ import org.junit.rules.TestRule; import org.junit.rules.Timeout; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; public class JwtGuardIT { + private final K3poRule k3po = new K3poRule() + .addScriptRoot("keys", "io/aklivity/zilla/specs/guard/jwt/config/keys"); + private final TestRule timeout = new DisableOnDebug(new Timeout(10, SECONDS)); private final EngineRule engine = new EngineRule() @@ -37,7 +42,7 @@ public class JwtGuardIT .clean(); @Rule - public final TestRule chain = outerRule(engine).around(timeout); + public final TestRule chain = outerRule(k3po).around(engine).around(timeout); @Test @Configuration("guard.yaml") @@ -47,13 +52,21 @@ public void shouldInitialize() throws Exception @Test @Configuration("guard-keys-dynamic.yaml") + @Specification({ + "${keys}/issuer" + }) public void shouldInitializeGuardWithDynamicKeys() throws Exception { + k3po.finish(); } @Test @Configuration("guard-keys-implicit.yaml") + @Specification({ + "${keys}/issuer" + }) public void shouldInitializeGuardWithImplicitKeys() throws Exception { + k3po.finish(); } } diff --git a/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/config/JwtKeySetConfigAdapterTest.java b/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/config/JwtKeySetConfigAdapterTest.java index 225813bc1e..1514aff91f 100644 --- a/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/config/JwtKeySetConfigAdapterTest.java +++ b/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/config/JwtKeySetConfigAdapterTest.java @@ -44,6 +44,28 @@ public void initJson() jsonb = JsonbBuilder.create(config); } + @Test + public void shouldReadJwtKeySetWhenKeysMissing() + { + String text = + "{" + + "}"; + JwtKeySetConfig jwksConfig = jsonb.fromJson(text, JwtKeySetConfig.class); + assertThat(jwksConfig.keys, nullValue()); + } + + @Test + public void shouldWriteJwtKeySetWithKeysMissing() + { + JwtKeySetConfig keySetConfig = new JwtKeySetConfig(null); + String text = jsonb.toJson(keySetConfig); + + assertThat(text, not(nullValue())); + assertThat(text, equalTo( + "{" + + "}")); + } + @Test public void shouldReadJwtKeySet() { @@ -81,7 +103,6 @@ public void shouldReadJwtKeySet() @Test public void shouldWriteJwtKeySet() { - JwtKeySetConfig keySetConfig = new JwtKeySetConfig(List.of(RFC7515_RS256_CONFIG, RFC7515_ES256_CONFIG)); String text = jsonb.toJson(keySetConfig); diff --git a/runtime/metrics-grpc/pom.xml b/runtime/metrics-grpc/pom.xml index 9a67d77b31..9c676d8370 100644 --- a/runtime/metrics-grpc/pom.xml +++ b/runtime/metrics-grpc/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.00 99 @@ -82,13 +80,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -183,7 +181,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/metrics-http/pom.xml b/runtime/metrics-http/pom.xml index f9f9e3ebf0..c00640a71a 100644 --- a/runtime/metrics-http/pom.xml +++ b/runtime/metrics-http/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.90 0 @@ -76,13 +74,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -177,7 +175,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/metrics-stream/pom.xml b/runtime/metrics-stream/pom.xml index 69d1036905..c65dcda22f 100644 --- a/runtime/metrics-stream/pom.xml +++ b/runtime/metrics-stream/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.90 0 @@ -76,13 +74,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -177,7 +175,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/model-avro/pom.xml b/runtime/model-avro/pom.xml index 3abb417c0d..45b635b98a 100644 --- a/runtime/model-avro/pom.xml +++ b/runtime/model-avro/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.88 0 @@ -65,13 +63,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -87,7 +85,7 @@ flyweight-maven-plugin ${project.version} - core avro_model + internal core avro_model io.aklivity.zilla.runtime.model.avro.internal.types @@ -214,7 +212,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroField.java b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroField.java new file mode 100644 index 0000000000..a5add03ebd --- /dev/null +++ b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroField.java @@ -0,0 +1,32 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.model.avro.internal; + +import org.agrona.MutableDirectBuffer; +import org.agrona.concurrent.UnsafeBuffer; + +import io.aklivity.zilla.runtime.model.avro.internal.types.OctetsFW; + +public class AvroField +{ + public final OctetsFW value; + public final MutableDirectBuffer buffer; + + public AvroField() + { + this.value = new OctetsFW(); + this.buffer = new UnsafeBuffer(new byte[24]); + } +} diff --git a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java index ab60c4de2f..1c65b2bf08 100644 --- a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java +++ b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java @@ -25,10 +25,8 @@ public final class AvroModelEventFormatter implements EventFormatterSpi { - private static final String VALIDATION_FAILED = "VALIDATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); - private final AvroModelEventExFW jsonModelEventExFW = new AvroModelEventExFW(); + private final AvroModelEventExFW avroModelEventExFW = new AvroModelEventExFW(); AvroModelEventFormatter( Configuration config) @@ -41,7 +39,7 @@ public String format( int length) { final EventFW event = eventRO.wrap(buffer, index, index + length); - final AvroModelEventExFW extension = jsonModelEventExFW + final AvroModelEventExFW extension = avroModelEventExFW .wrap(event.extension().buffer(), event.extension().offset(), event.extension().limit()); String result = null; switch (extension.kind()) @@ -49,7 +47,7 @@ public String format( case VALIDATION_FAILED: { AvroModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format(VALIDATION_FAILED, asString(ex.error())); + result = String.format("A message payload failed validation. %s.", asString(ex.error())); break; } } diff --git a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelHandler.java b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelHandler.java index e2fc37713d..946e714e4f 100644 --- a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelHandler.java +++ b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelHandler.java @@ -19,9 +19,12 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.HashMap; +import java.util.Map; import org.agrona.DirectBuffer; import org.agrona.ExpandableDirectByteBuffer; +import org.agrona.MutableDirectBuffer; import org.agrona.collections.Int2IntHashMap; import org.agrona.collections.Int2ObjectCache; import org.agrona.io.DirectBufferInputStream; @@ -42,6 +45,13 @@ import io.aklivity.zilla.runtime.engine.config.CatalogedConfig; import io.aklivity.zilla.runtime.engine.config.SchemaConfig; import io.aklivity.zilla.runtime.model.avro.config.AvroModelConfig; +import io.aklivity.zilla.runtime.model.avro.internal.types.AvroBooleanFW; +import io.aklivity.zilla.runtime.model.avro.internal.types.AvroBytesFW; +import io.aklivity.zilla.runtime.model.avro.internal.types.AvroDoubleFW; +import io.aklivity.zilla.runtime.model.avro.internal.types.AvroFloatFW; +import io.aklivity.zilla.runtime.model.avro.internal.types.AvroIntFW; +import io.aklivity.zilla.runtime.model.avro.internal.types.AvroLongFW; +import io.aklivity.zilla.runtime.model.avro.internal.types.OctetsFW; public abstract class AvroModelHandler { @@ -66,12 +76,20 @@ public abstract class AvroModelHandler protected final ExpandableDirectBufferOutputStream expandable; protected final DirectBufferInputStream in; protected final AvroModelEventContext event; + protected final Map extracted; private final Int2ObjectCache schemas; private final Int2ObjectCache> readers; private final Int2ObjectCache> writers; private final Int2ObjectCache records; private final Int2IntHashMap paddings; + private final AvroBytesFW bytesRO; + private final AvroIntFW intRO; + private final AvroLongFW longRO; + private final AvroFloatFW floatRO; + private final AvroDoubleFW doubleRO; + + protected int progress; protected AvroModelHandler( AvroModelConfig config, @@ -96,6 +114,13 @@ protected AvroModelHandler( this.expandable = new ExpandableDirectBufferOutputStream(new ExpandableDirectByteBuffer()); this.in = new DirectBufferInputStream(); this.event = new AvroModelEventContext(context); + this.extracted = new HashMap<>(); + this.bytesRO = new AvroBytesFW(); + this.intRO = new AvroIntFW(); + this.longRO = new AvroLongFW(); + this.floatRO = new AvroFloatFW(); + this.doubleRO = new AvroDoubleFW(); + } protected final boolean validate( @@ -112,11 +137,16 @@ protected final boolean validate( GenericRecord record = supplyRecord(schemaId); in.wrap(buffer, index, length); GenericDatumReader reader = supplyReader(schemaId); + Schema schema = supplySchema(schemaId); if (reader != null) { - reader.read(record, decoderFactory.binaryDecoder(in, decoder)); + decoderFactory.binaryDecoder(in, decoder); + reader.read(record, decoder); status = true; + } + progress = index; + extractFields(buffer, length, schema); } catch (IOException | AvroRuntimeException ex) { @@ -125,6 +155,17 @@ protected final boolean validate( return status; } + protected void extractFields( + DirectBuffer buffer, + int length, + Schema schema) + { + for (Schema.Field field : schema.getFields()) + { + extract(field.schema(), buffer, length, extracted.get(field.name())); + } + } + protected final Schema supplySchema( int schemaId) { @@ -250,4 +291,111 @@ private int calculatePadding( } return padding; } + + private void extract( + Schema schema, + DirectBuffer data, + int limit, + AvroField field) + { + switch (schema.getType()) + { + case RECORD: + extractFields(data, limit, schema); + break; + case BYTES: + case STRING: + AvroBytesFW bytes = bytesRO.wrap(data, progress, limit); + OctetsFW value = bytes.value(); + progress = bytes.limit(); + if (field != null) + { + OctetsFW octets = field.value; + octets.wrap(value.buffer(), value.offset(), value.limit()); + } + break; + case ENUM: + case INT: + AvroIntFW int32 = intRO.wrap(data, progress, limit); + int intValue = int32.value(); + progress = int32.limit(); + if (field != null) + { + MutableDirectBuffer text = field.buffer; + int length = text.putIntAscii(0, intValue); + field.value.wrap(text, 0, length); + } + break; + case FLOAT: + AvroFloatFW avroFloat = floatRO.wrap(data, progress, limit); + int len = 0; + DirectBuffer buffer = avroFloat.value().value(); + float floatValue = Float.intBitsToFloat(decodeNumberBytes(len, buffer)); + progress = avroFloat.limit(); + if (field != null) + { + MutableDirectBuffer text = field.buffer; + int length = text.putStringWithoutLengthAscii(0, String.valueOf(floatValue)); + field.value.wrap(text, 0, length); + } + break; + case LONG: + AvroLongFW avroLong = longRO.wrap(data, progress, limit); + long longValue = avroLong.value(); + progress = avroLong.limit(); + if (field != null) + { + MutableDirectBuffer text = field.buffer; + int length = text.putLongAscii(0, longValue); + field.value.wrap(text, 0, length); + } + break; + case DOUBLE: + AvroDoubleFW avroDouble = doubleRO.wrap(data, progress, limit); + len = 0; + buffer = avroDouble.value().value(); + int decoded = (buffer.getByte(len++) & 0xff) | + ((buffer.getByte(len++) & 0xff) << 8) | + ((buffer.getByte(len++) & 0xff) << 16) | + ((buffer.getByte(len++) & 0xff) << 24); + + double doubleValue = Double.longBitsToDouble((((long) decoded) & 0xffffffffL) | + (((long) decodeNumberBytes(len, buffer)) << 32)); + progress = avroDouble.limit(); + if (field != null) + { + MutableDirectBuffer text = field.buffer; + int length = text.putStringWithoutLengthAscii(0, String.valueOf(doubleValue)); + field.value.wrap(text, 0, length); + } + break; + case BOOLEAN: + AvroBooleanFW avroBoolean = new AvroBooleanFW().wrap(data, progress, limit); + value = avroBoolean.value(); + progress = avroBoolean.limit(); + if (field != null) + { + field.value.wrap(value.buffer(), value.offset(), value.limit()); + } + break; + case FIXED: + int fixedSize = schema.getFixedSize(); + if (field != null) + { + field.value.wrap(data, progress, progress + fixedSize); + } + progress += fixedSize; + break; + } + } + + private static int decodeNumberBytes( + int len, + DirectBuffer buffer) + { + return (buffer.getByte(len++) & 0xff) | + ((buffer.getByte(len++) & 0xff) << 8) | + ((buffer.getByte(len++) & 0xff) << 16) | + ((buffer.getByte(len) & 0xff) << 24); + } } diff --git a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroReadConverterHandler.java b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroReadConverterHandler.java index 73a9387a96..f33405e7cd 100644 --- a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroReadConverterHandler.java +++ b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroReadConverterHandler.java @@ -17,8 +17,11 @@ import static io.aklivity.zilla.runtime.engine.catalog.CatalogHandler.NO_SCHEMA_ID; import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.agrona.DirectBuffer; +import org.agrona.concurrent.UnsafeBuffer; import org.apache.avro.AvroRuntimeException; import org.apache.avro.Schema; import org.apache.avro.generic.GenericDatumReader; @@ -30,14 +33,22 @@ import io.aklivity.zilla.runtime.engine.model.ConverterHandler; import io.aklivity.zilla.runtime.engine.model.function.ValueConsumer; import io.aklivity.zilla.runtime.model.avro.config.AvroModelConfig; +import io.aklivity.zilla.runtime.model.avro.internal.types.OctetsFW; public class AvroReadConverterHandler extends AvroModelHandler implements ConverterHandler { + private static final String PATH = "^\\$\\.([A-Za-z_][A-Za-z0-9_]*)$"; + private static final Pattern PATH_PATTERN = Pattern.compile(PATH); + private static final DirectBuffer EMPTY_BUFFER = new UnsafeBuffer(); + + private final Matcher matcher; + public AvroReadConverterHandler( AvroModelConfig config, EngineContext context) { super(config, context); + this.matcher = PATH_PATTERN.matcher(""); } @Override @@ -46,7 +57,7 @@ public int padding( int index, int length) { - int padding = 0; + int padding = handler.decodePadding(data, index, length); if (VIEW_JSON.equals(view)) { int schemaId = handler.resolve(data, index, length); @@ -62,11 +73,21 @@ public int padding( schemaId = handler.resolve(subject, catalog.version); } } - padding = supplyPadding(schemaId); + padding += supplyPadding(schemaId); } return padding; } + @Override + public void extract( + String path) + { + if (matcher.reset(path).matches()) + { + extracted.put(matcher.group(1), new AvroField()); + } + } + @Override public int convert( long traceId, @@ -76,9 +97,40 @@ public int convert( int length, ValueConsumer next) { + for (AvroField field: extracted.values()) + { + field.value.wrap(EMPTY_BUFFER, 0, 0); + } return handler.decode(traceId, bindingId, data, index, length, next, this::decodePayload); } + @Override + public int extractedLength( + String path) + { + OctetsFW value = null; + if (matcher.reset(path).matches()) + { + value = extracted.get(matcher.group(1)).value; + } + return value != null ? value.sizeof() : 0; + } + + @Override + public void extracted( + String path, + FieldVisitor visitor) + { + if (matcher.reset(path).matches()) + { + OctetsFW value = extracted.get(matcher.group(1)).value; + if (value != null && value.sizeof() != 0) + { + visitor.visit(value.buffer(), value.offset(), value.sizeof()); + } + } + } + private int decodePayload( long traceId, long bindingId, @@ -142,6 +194,9 @@ record = reader.read(record, decoderFactory.binaryDecoder(in, decoder)); JsonEncoder out = encoderFactory.jsonEncoder(schema, expandable); writer.write(record, out); out.flush(); + + progress = index; + extractFields(buffer, length, schema); } } catch (IOException | AvroRuntimeException ex) diff --git a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroWriteConverterHandler.java b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroWriteConverterHandler.java index 8eb24d2cc7..2889dcf0f5 100644 --- a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroWriteConverterHandler.java +++ b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroWriteConverterHandler.java @@ -44,7 +44,7 @@ public int padding( int index, int length) { - return handler.encodePadding(); + return handler.encodePadding(length); } @Override diff --git a/runtime/model-avro/src/main/zilla/internal.idl b/runtime/model-avro/src/main/zilla/internal.idl new file mode 100644 index 0000000000..2dd4b754b6 --- /dev/null +++ b/runtime/model-avro/src/main/zilla/internal.idl @@ -0,0 +1,47 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +scope internal +{ + struct AvroBytes + { + varint32 length; + octets[length] value; + } + + struct AvroDouble + { + octets[8] value; + } + + struct AvroFloat + { + octets[4] value; + } + + struct AvroInt + { + varint32 value; + } + + struct AvroLong + { + varint64 value; + } + + struct AvroBoolean + { + octets[1] value; + } +} diff --git a/runtime/model-avro/src/test/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelTest.java b/runtime/model-avro/src/test/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelTest.java index 3047700ebe..cf276a226e 100644 --- a/runtime/model-avro/src/test/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelTest.java +++ b/runtime/model-avro/src/test/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelTest.java @@ -28,6 +28,7 @@ import io.aklivity.zilla.runtime.engine.EngineContext; import io.aklivity.zilla.runtime.engine.binding.function.MessageConsumer; import io.aklivity.zilla.runtime.engine.config.CatalogConfig; +import io.aklivity.zilla.runtime.engine.model.ConverterHandler; import io.aklivity.zilla.runtime.engine.model.function.ValueConsumer; import io.aklivity.zilla.runtime.engine.test.internal.catalog.TestCatalogHandler; import io.aklivity.zilla.runtime.engine.test.internal.catalog.config.TestCatalogOptionsConfig; @@ -39,6 +40,16 @@ public class AvroModelTest "{\"name\":\"status\",\"type\":\"string\"}]," + "\"name\":\"Event\",\"namespace\":\"io.aklivity.example\",\"type\":\"record\"}"; + private static final String SCHEMA_OBJECT = "{\"type\":\"record\",\"name\":\"ExampleRecord\"," + + "\"namespace\":\"com.example\"," + + "\"fields\":[" + + "{\"name\":\"bytesField\",\"type\":\"bytes\"}," + + "{\"name\":\"stringField\",\"type\":\"string\"}," + + "{\"name\":\"intField\",\"type\":\"int\"}," + + "{\"name\":\"floatField\",\"type\":\"float\"}," + + "{\"name\":\"longField\",\"type\":\"long\"}," + + "{\"name\":\"doubleField\",\"type\":\"double\"}]}"; + private static final String COMPLEX_SCHEMA = "{\"type\":\"record\",\"name\":\"example\",\"namespace\":\"com.example\"," + "\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"preferences\",\"" + "type\":{\"type\":\"map\",\"values\":\"string\"}},{\"name\":\"attributes\",\"" + @@ -241,4 +252,62 @@ public void shouldVerifyPaddingLength() assertEquals(260, converter.padding(data, 0, data.capacity())); } + + @Test + public void shouldExtract() + { + TestCatalogOptionsConfig testCatalogOptionsConfig = TestCatalogOptionsConfig.builder() + .id(9) + .schema(SCHEMA_OBJECT) + .build(); + CatalogConfig catalogConfig = new CatalogConfig("test", "test0", "test", testCatalogOptionsConfig); + when(context.supplyCatalog(catalogConfig.id)).thenReturn(new TestCatalogHandler(testCatalogOptionsConfig)); + AvroReadConverterHandler converter = new AvroReadConverterHandler(avroConfig, context); + + String stringPath = "$.stringField"; + converter.extract(stringPath); + + String intPath = "$.intField"; + converter.extract(intPath); + + String floatPath = "$.floatField"; + converter.extract(floatPath); + + String longPath = "$.longField"; + converter.extract(longPath); + + String doublePath = "$.doubleField"; + converter.extract(doublePath); + + DirectBuffer data = new UnsafeBuffer(); + + byte[] bytes = {0, 16, 112, 111, 115, 105, 116, 105, 118, 101, 2, -51, -52, 12, 64, 2, 51, 51, 51, 51, 51, 51, -13, 63}; + data.wrap(bytes, 0, bytes.length); + assertEquals(data.capacity(), converter.convert(0L, 0L, data, 0, data.capacity(), ValueConsumer.NOP)); + + assertEquals(8, converter.extractedLength(stringPath)); + ConverterHandler.FieldVisitor visitor = (buffer, index, length) -> + { + assertEquals("positive", buffer.getStringWithoutLengthUtf8(index, length)); + }; + converter.extracted(stringPath, visitor); + + ConverterHandler.FieldVisitor doubleVisitor = (buffer, index, length) -> + { + assertEquals("1.2", buffer.getStringWithoutLengthUtf8(index, length)); + }; + converter.extracted(doublePath, doubleVisitor); + + ConverterHandler.FieldVisitor intVisitor = (buffer, index, length) -> + { + assertEquals("1", buffer.getStringWithoutLengthUtf8(index, length)); + }; + converter.extracted(intPath, intVisitor); + + ConverterHandler.FieldVisitor floatVisitor = (buffer, index, length) -> + { + assertEquals("2.2", buffer.getStringWithoutLengthUtf8(index, length)); + }; + converter.extracted(floatPath, floatVisitor); + } } diff --git a/runtime/model-avro/src/test/java/io/aklivity/zilla/runtime/model/avro/internal/EventIT.java b/runtime/model-avro/src/test/java/io/aklivity/zilla/runtime/model/avro/internal/EventIT.java index 3045d11789..37433fec5a 100644 --- a/runtime/model-avro/src/test/java/io/aklivity/zilla/runtime/model/avro/internal/EventIT.java +++ b/runtime/model-avro/src/test/java/io/aklivity/zilla/runtime/model/avro/internal/EventIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/model-core/pom.xml b/runtime/model-core/pom.xml index 310d200c68..6e90a88c6e 100644 --- a/runtime/model-core/pom.xml +++ b/runtime/model-core/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.86 0 @@ -61,13 +59,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -182,7 +180,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java b/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java index 36fef012ce..6ca60dbce5 100644 --- a/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java +++ b/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java @@ -25,8 +25,6 @@ public final class CoreModelEventFormatter implements EventFormatterSpi { - private static final String VALIDATION_FAILED = "VALIDATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final CoreModelEventExFW coreModelEventExFW = new CoreModelEventExFW(); @@ -49,7 +47,10 @@ public String format( case VALIDATION_FAILED: { CoreModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format(VALIDATION_FAILED, asString(ex.error())); + result = String.format( + "A message payload failed validation. A field was not the expected type (%s).", + asString(ex.error()) + ); break; } } diff --git a/runtime/model-core/src/test/java/io/aklivity/zilla/runtime/model/core/internal/EventIT.java b/runtime/model-core/src/test/java/io/aklivity/zilla/runtime/model/core/internal/EventIT.java index 73f247f551..94b1bdee2f 100644 --- a/runtime/model-core/src/test/java/io/aklivity/zilla/runtime/model/core/internal/EventIT.java +++ b/runtime/model-core/src/test/java/io/aklivity/zilla/runtime/model/core/internal/EventIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/model-json/pom.xml b/runtime/model-json/pom.xml index 97213c966b..41631ef69e 100644 --- a/runtime/model-json/pom.xml +++ b/runtime/model-json/pom.xml @@ -1,193 +1,191 @@ -4.0.0 - - io.aklivity.zilla - runtime - 0.9.82 - ../pom.xml + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + io.aklivity.zilla + runtime + 0.9.83 + ../pom.xml model-json zilla::runtime::model-json - - Aklivity Community License Agreement - https://www.aklivity.io/aklivity-community-license/ - repo - + + Aklivity Community License Agreement + https://www.aklivity.io/aklivity-community-license/ + repo + - 11 - 11 - 0.87 - 0 + 0.87 + 0 - - ${project.groupId} - model-json.spec - ${project.version} - provided - - - ${project.groupId} - engine - ${project.version} - provided - - - jakarta.json - jakarta.json-api - - - org.leadpony.justify - justify - - - ${project.groupId} - engine - test-jar - ${project.version} - test - - - org.kaazing - k3po.junit - test - - - org.kaazing - k3po.lang - test - - - org.mockito - mockito-core - test - + + ${project.groupId} + model-json.spec + ${project.version} + provided + + + ${project.groupId} + engine + ${project.version} + provided + + + jakarta.json + jakarta.json-api + + + org.leadpony.justify + justify + + + ${project.groupId} + engine + test-jar + ${project.version} + test + + + io.aklivity.k3po + control-junit + test + + + io.aklivity.k3po + lang + test + + + org.mockito + mockito-core + test + - - - org.jasig.maven - maven-notice-plugin - - - ${project.groupId} - flyweight-maven-plugin - ${project.version} - - core json_model - io.aklivity.zilla.runtime.model.json.internal.types - - - - - generate - - - - - - com.mycila - license-maven-plugin - - - maven-checkstyle-plugin - - - maven-dependency-plugin - - - process-resources - - unpack - - - - - ${project.groupId} - model-json.spec - - - ^\Qio/aklivity/zilla/specs/model/json/\E - io/aklivity/zilla/runtime/model/json/internal/ - - - - - io/aklivity/zilla/specs/model/json/schema/json.schema.patch.json - ${project.build.directory}/classes - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - - org.moditect - moditect-maven-plugin - - - org.apache.maven.plugins - maven-failsafe-plugin - - - org.jacoco - jacoco-maven-plugin - - - io/aklivity/zilla/runtime/model/json/internal/types/**/*.class - - - - BUNDLE - - - INSTRUCTION - COVEREDRATIO - ${jacoco.coverage.ratio} - - - CLASS - MISSEDCOUNT - ${jacoco.missed.count} - - - - - - - - org.kaazing - k3po-maven-plugin - - - ${project.groupId} - engine - ${project.version} - test-jar - - - ${project.groupId} - engine - ${project.version} - - - - + + + org.jasig.maven + maven-notice-plugin + + + ${project.groupId} + flyweight-maven-plugin + ${project.version} + + core json_model + io.aklivity.zilla.runtime.model.json.internal.types + + + + + generate + + + + + + com.mycila + license-maven-plugin + + + maven-checkstyle-plugin + + + maven-dependency-plugin + + + process-resources + + unpack + + + + + ${project.groupId} + model-json.spec + + + ^\Qio/aklivity/zilla/specs/model/json/\E + io/aklivity/zilla/runtime/model/json/internal/ + + + + + io/aklivity/zilla/specs/model/json/schema/json.schema.patch.json + ${project.build.directory}/classes + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + + org.moditect + moditect-maven-plugin + + + org.apache.maven.plugins + maven-failsafe-plugin + + + org.jacoco + jacoco-maven-plugin + + + io/aklivity/zilla/runtime/model/json/internal/types/**/*.class + + + + BUNDLE + + + INSTRUCTION + COVEREDRATIO + ${jacoco.coverage.ratio} + + + CLASS + MISSEDCOUNT + ${jacoco.missed.count} + + + + + + + + io.aklivity.k3po + k3po-maven-plugin + + + ${project.groupId} + engine + ${project.version} + test-jar + + + ${project.groupId} + engine + ${project.version} + + + + diff --git a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java index c0886ac5c5..a6ad7a690c 100644 --- a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java +++ b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java @@ -25,8 +25,6 @@ public final class JsonModelEventFormatter implements EventFormatterSpi { - private static final String VALIDATION_FAILED = "VALIDATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final JsonModelEventExFW jsonModelEventExFW = new JsonModelEventExFW(); @@ -49,7 +47,7 @@ public String format( case VALIDATION_FAILED: { JsonModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format(VALIDATION_FAILED, asString(ex.error())); + result = String.format("A message payload failed validation. %s.", asString(ex.error())); break; } } diff --git a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelHandler.java b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelHandler.java index 7723ef7c6a..95dd285404 100644 --- a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelHandler.java +++ b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelHandler.java @@ -15,6 +15,8 @@ package io.aklivity.zilla.runtime.model.json.internal; import java.io.StringReader; +import java.util.HashMap; +import java.util.Map; import jakarta.json.spi.JsonProvider; import jakarta.json.stream.JsonParser; @@ -22,6 +24,7 @@ import org.agrona.DirectBuffer; import org.agrona.collections.Int2ObjectCache; +import org.agrona.concurrent.UnsafeBuffer; import org.agrona.io.DirectBufferInputStream; import org.leadpony.justify.api.JsonSchema; import org.leadpony.justify.api.JsonSchemaReader; @@ -34,19 +37,26 @@ import io.aklivity.zilla.runtime.engine.config.CatalogedConfig; import io.aklivity.zilla.runtime.engine.config.SchemaConfig; import io.aklivity.zilla.runtime.model.json.config.JsonModelConfig; +import io.aklivity.zilla.runtime.model.json.internal.types.OctetsFW; public abstract class JsonModelHandler { + private static final DirectBuffer EMPTY_BUFFER = new UnsafeBuffer(); + private static final int DOUBLE_QUOTE_LENGTH = 1; + protected final SchemaConfig catalog; protected final CatalogHandler handler; protected final String subject; protected final JsonModelEventContext event; + protected final Map extracted; private final Int2ObjectCache schemas; private final Int2ObjectCache providers; private final JsonProvider schemaProvider; private final JsonValidationService service; private final JsonParserFactory factory; + + private JsonParser parser; private DirectBufferInputStream in; public JsonModelHandler( @@ -66,6 +76,7 @@ public JsonModelHandler( this.providers = new Int2ObjectCache<>(1, 1024, i -> {}); this.in = new DirectBufferInputStream(); this.event = new JsonModelEventContext(context); + this.extracted = new HashMap<>(); } protected final boolean validate( @@ -83,8 +94,47 @@ protected final boolean validate( status &= provider != null; if (status) { + for (OctetsFW value: extracted.values()) + { + value.wrap(EMPTY_BUFFER, 0, 0); + } in.wrap(buffer, index, length); - provider.createReader(in).readValue(); + parser = provider.createParser(in); + OctetsFW valueBytes = null; + while (parser.hasNext()) + { + JsonParser.Event event = parser.next(); + if (!extracted.isEmpty()) + { + switch (event) + { + case KEY_NAME: + String key = parser.getString(); + valueBytes = extracted.get(key); + break; + case VALUE_STRING: + if (valueBytes != null) + { + int offset = (int) parser.getLocation().getStreamOffset() - DOUBLE_QUOTE_LENGTH; + offset += index; + int valLength = calculateValueLength(); + valueBytes.wrap(in.buffer(), offset - valLength, offset); + valueBytes = null; + } + break; + case VALUE_NUMBER: + if (valueBytes != null) + { + int offset = (int) parser.getLocation().getStreamOffset(); + offset += index; + int valLength = calculateValueLength(); + valueBytes.wrap(in.buffer(), offset - valLength, offset); + valueBytes = null; + } + break; + } + } + } } } catch (JsonValidatingException ex) @@ -95,6 +145,35 @@ protected final boolean validate( return status; } + private int calculateValueLength() + { + int length = 0; + String value = parser.getString(); + int valLength = value.length(); + for (int i = 0; i < valLength; i++) + { + char c = value.charAt(i); + if ((c & 0xFF80) == 0) + { + length += 1; + } + else if ((c & 0xF800) == 0) + { + length += 2; + } + else if (Character.isHighSurrogate(c)) + { + length += 4; + i++; + } + else + { + length += 3; + } + } + return length; + } + protected JsonProvider supplyProvider( int schemaId) { diff --git a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonReadConverterHandler.java b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonReadConverterHandler.java index 18629549aa..5762c2c7e7 100644 --- a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonReadConverterHandler.java +++ b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonReadConverterHandler.java @@ -16,20 +16,49 @@ import static io.aklivity.zilla.runtime.engine.catalog.CatalogHandler.NO_SCHEMA_ID; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import org.agrona.DirectBuffer; import io.aklivity.zilla.runtime.engine.EngineContext; import io.aklivity.zilla.runtime.engine.model.ConverterHandler; import io.aklivity.zilla.runtime.engine.model.function.ValueConsumer; import io.aklivity.zilla.runtime.model.json.config.JsonModelConfig; +import io.aklivity.zilla.runtime.model.json.internal.types.OctetsFW; public class JsonReadConverterHandler extends JsonModelHandler implements ConverterHandler { + private static final String PATH = "^\\$\\.([A-Za-z_][A-Za-z0-9_]*)$"; + private static final Pattern PATH_PATTERN = Pattern.compile(PATH); + + private final Matcher matcher; + public JsonReadConverterHandler( JsonModelConfig config, EngineContext context) { super(config, context); + this.matcher = PATH_PATTERN.matcher(""); + } + + @Override + public int padding( + DirectBuffer data, + int index, + int length) + { + return handler.decodePadding(data, index, length); + } + + @Override + public void extract( + String path) + { + if (matcher.reset(path).matches()) + { + extracted.put(matcher.group(1), new OctetsFW()); + } } @Override @@ -44,6 +73,33 @@ public int convert( return handler.decode(traceId, bindingId, data, index, length, next, this::decodePayload); } + @Override + public int extractedLength( + String path) + { + OctetsFW value = null; + if (matcher.reset(path).matches()) + { + value = extracted.get(matcher.group(1)); + } + return value != null ? value.sizeof() : 0; + } + + @Override + public void extracted( + String path, + FieldVisitor visitor) + { + if (matcher.reset(path).matches()) + { + OctetsFW value = extracted.get(matcher.group(1)); + if (value != null && value.sizeof() != 0) + { + visitor.visit(value.buffer(), value.offset(), value.sizeof()); + } + } + } + private int decodePayload( long traceId, long bindingId, diff --git a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonValidatorHandler.java b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonValidatorHandler.java index a62d3a9794..56da97c8ac 100644 --- a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonValidatorHandler.java +++ b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonValidatorHandler.java @@ -32,8 +32,8 @@ public class JsonValidatorHandler extends JsonModelHandler implements ValidatorH private final DirectBufferInputStream in; private final ExpandableDirectByteBuffer buffer; - private JsonParser parser; private int progress; + private JsonParser parser; public JsonValidatorHandler( JsonModelConfig config, diff --git a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonWriteConverterHandler.java b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonWriteConverterHandler.java index 28ac68f9a0..d841dfcbc2 100644 --- a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonWriteConverterHandler.java +++ b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonWriteConverterHandler.java @@ -37,7 +37,7 @@ public int padding( int index, int length) { - return handler.encodePadding(); + return handler.encodePadding(length); } @Override diff --git a/runtime/model-json/src/test/java/io/aklivity/zilla/runtime/model/json/internal/EventIT.java b/runtime/model-json/src/test/java/io/aklivity/zilla/runtime/model/json/internal/EventIT.java index a3d2de2cde..b2ae1af729 100644 --- a/runtime/model-json/src/test/java/io/aklivity/zilla/runtime/model/json/internal/EventIT.java +++ b/runtime/model-json/src/test/java/io/aklivity/zilla/runtime/model/json/internal/EventIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/model-json/src/test/java/io/aklivity/zilla/runtime/model/json/internal/JsonConverterTest.java b/runtime/model-json/src/test/java/io/aklivity/zilla/runtime/model/json/internal/JsonConverterTest.java index e07736c310..83fea69d75 100644 --- a/runtime/model-json/src/test/java/io/aklivity/zilla/runtime/model/json/internal/JsonConverterTest.java +++ b/runtime/model-json/src/test/java/io/aklivity/zilla/runtime/model/json/internal/JsonConverterTest.java @@ -29,6 +29,7 @@ import io.aklivity.zilla.runtime.engine.EngineContext; import io.aklivity.zilla.runtime.engine.binding.function.MessageConsumer; import io.aklivity.zilla.runtime.engine.config.CatalogConfig; +import io.aklivity.zilla.runtime.engine.model.ConverterHandler; import io.aklivity.zilla.runtime.engine.model.function.ValueConsumer; import io.aklivity.zilla.runtime.engine.test.internal.catalog.TestCatalogHandler; import io.aklivity.zilla.runtime.engine.test.internal.catalog.config.TestCatalogOptionsConfig; @@ -43,6 +44,9 @@ public class JsonConverterTest "\"id\": {" + "\"type\": \"string\"" + "}," + + "\"zillaId\": {" + + "\"type\": \"integer\"" + + "}," + "\"status\": {" + "\"type\": \"string\"" + "}" + @@ -208,4 +212,48 @@ public void shouldVerifyInvalidJsonArray() assertEquals(-1, converter.convert(0L, 0L, data, 0, data.capacity(), ValueConsumer.NOP)); } + + @Test + public void shouldExtract() + { + TestCatalogOptionsConfig testCatalogOptionsConfig = TestCatalogOptionsConfig.builder() + .id(9) + .schema(OBJECT_SCHEMA) + .build(); + CatalogConfig catalogConfig = new CatalogConfig("test", "test0", "test", testCatalogOptionsConfig); + when(context.supplyCatalog(catalogConfig.id)).thenReturn(new TestCatalogHandler(testCatalogOptionsConfig)); + JsonReadConverterHandler converter = new JsonReadConverterHandler(config, context); + + String statusPath = "$.status"; + converter.extract(statusPath); + + String zillaIdPath = "$.zillaId"; + converter.extract(zillaIdPath); + + DirectBuffer data = new UnsafeBuffer(); + + String payload = + "{" + + "\"id\": \"123\"," + + "\"zillaId\": 321," + + "\"status\": \"OK\"" + + "}"; + byte[] bytes = payload.getBytes(); + data.wrap(bytes, 0, bytes.length); + assertEquals(data.capacity(), converter.convert(0L, 0L, data, 0, data.capacity(), ValueConsumer.NOP)); + + assertEquals(2, converter.extractedLength(statusPath)); + final ConverterHandler.FieldVisitor visitor = (buffer, index, length) -> + { + assertEquals("OK", buffer.getStringWithoutLengthUtf8(index, length)); + }; + converter.extracted(statusPath, visitor); + + assertEquals(3, converter.extractedLength(zillaIdPath)); + final ConverterHandler.FieldVisitor zillaIdVisitor = (buffer, index, length) -> + { + assertEquals("321", buffer.getStringWithoutLengthUtf8(index, length)); + }; + converter.extracted(zillaIdPath, zillaIdVisitor); + } } diff --git a/runtime/model-protobuf/pom.xml b/runtime/model-protobuf/pom.xml index e81ff80984..f0f1d571aa 100644 --- a/runtime/model-protobuf/pom.xml +++ b/runtime/model-protobuf/pom.xml @@ -1,226 +1,224 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 + http://maven.apache.org/xsd/maven-4.0.0.xsd"> -4.0.0 - - io.aklivity.zilla - runtime - 0.9.82 - ../pom.xml + 4.0.0 + + io.aklivity.zilla + runtime + 0.9.83 + ../pom.xml model-protobuf zilla::runtime::model-protobuf - - Aklivity Community License Agreement - https://www.aklivity.io/aklivity-community-license/ - repo - + + Aklivity Community License Agreement + https://www.aklivity.io/aklivity-community-license/ + repo + - 11 - 11 - 0.92 - 0 + 0.89 + 0 - - ${project.groupId} - model-protobuf.spec - ${project.version} - provided - - - ${project.groupId} - engine - ${project.version} - provided - - - com.google.protobuf - protobuf-java - 3.24.4 - - - com.google.protobuf - protobuf-java-util - 3.24.4 - - - org.antlr - antlr4-runtime - provided - - - ${project.groupId} - engine - test-jar - ${project.version} - test - - - org.kaazing - k3po.junit - test - - - org.kaazing - k3po.lang - test - - - org.mockito - mockito-core - test - + + ${project.groupId} + model-protobuf.spec + ${project.version} + provided + + + ${project.groupId} + engine + ${project.version} + provided + + + com.google.protobuf + protobuf-java + 3.24.4 + + + com.google.protobuf + protobuf-java-util + 3.24.4 + + + org.antlr + antlr4-runtime + provided + + + ${project.groupId} + engine + test-jar + ${project.version} + test + + + io.aklivity.k3po + control-junit + test + + + io.aklivity.k3po + lang + test + + + org.mockito + mockito-core + test + - - - org.jasig.maven - maven-notice-plugin - - - ${project.groupId} - flyweight-maven-plugin - ${project.version} - - core protobuf_model - io.aklivity.zilla.runtime.model.protobuf.internal.types - - - - - generate - - - - - - com.mycila - license-maven-plugin - - - maven-checkstyle-plugin - - - org.antlr - antlr4-maven-plugin - - - maven-dependency-plugin - - - process-resources - - unpack - - - - - ${project.groupId} - model-protobuf.spec - - - ^\Qio/aklivity/zilla/specs/model/protobuf/\E - io/aklivity/zilla/runtime/model/protobuf/internal/ - - - - - io/aklivity/zilla/specs/model/protobuf/schema/protobuf.schema.patch.json - ${project.build.directory}/classes - - - - unpack-proto - generate-sources - - unpack - - - - - ${project.groupId} - model-protobuf.spec - ${project.version} - ${basedir}/target/test-classes - **\/*.proto - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - - org.moditect - moditect-maven-plugin - - - org.apache.maven.plugins - maven-failsafe-plugin - - - org.jacoco - jacoco-maven-plugin - - - io/aklivity/zilla/runtime/model/protobuf/internal/parser/**/*.class - io/aklivity/zilla/runtime/model/protobuf/internal/types/**/*.class - - - - BUNDLE - - - INSTRUCTION - COVEREDRATIO - ${jacoco.coverage.ratio} - - - CLASS - MISSEDCOUNT - ${jacoco.missed.count} - - - - - - - - org.kaazing - k3po-maven-plugin - - - ${project.groupId} - engine - ${project.version} - test-jar - - - ${project.groupId} - engine - ${project.version} - - - - + + + org.jasig.maven + maven-notice-plugin + + + ${project.groupId} + flyweight-maven-plugin + ${project.version} + + core protobuf_model + io.aklivity.zilla.runtime.model.protobuf.internal.types + + + + + generate + + + + + + com.mycila + license-maven-plugin + + + maven-checkstyle-plugin + + + org.antlr + antlr4-maven-plugin + + + maven-dependency-plugin + + + process-resources + + unpack + + + + + ${project.groupId} + model-protobuf.spec + + + ^\Qio/aklivity/zilla/specs/model/protobuf/\E + io/aklivity/zilla/runtime/model/protobuf/internal/ + + + + + io/aklivity/zilla/specs/model/protobuf/schema/protobuf.schema.patch.json + ${project.build.directory}/classes + + + + unpack-proto + generate-sources + + unpack + + + + + ${project.groupId} + model-protobuf.spec + ${project.version} + ${basedir}/target/test-classes + **\/*.proto + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + + org.moditect + moditect-maven-plugin + + + org.apache.maven.plugins + maven-failsafe-plugin + + + org.jacoco + jacoco-maven-plugin + + + io/aklivity/zilla/runtime/model/protobuf/internal/parser/**/*.class + io/aklivity/zilla/runtime/model/protobuf/internal/types/**/*.class + + + + BUNDLE + + + INSTRUCTION + COVEREDRATIO + ${jacoco.coverage.ratio} + + + CLASS + MISSEDCOUNT + ${jacoco.missed.count} + + + + + + + + io.aklivity.k3po + k3po-maven-plugin + + + ${project.groupId} + engine + ${project.version} + test-jar + + + ${project.groupId} + engine + ${project.version} + + + + \ No newline at end of file diff --git a/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufField.java b/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufField.java new file mode 100644 index 0000000000..dca0a2d08f --- /dev/null +++ b/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufField.java @@ -0,0 +1,32 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.model.protobuf.internal; + +import org.agrona.MutableDirectBuffer; +import org.agrona.concurrent.UnsafeBuffer; + +import io.aklivity.zilla.runtime.model.protobuf.internal.types.OctetsFW; + +public class ProtobufField +{ + public final OctetsFW value; + public final MutableDirectBuffer buffer; + + public ProtobufField() + { + this.value = new OctetsFW(); + this.buffer = new UnsafeBuffer(new byte[24]); + } +} diff --git a/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java b/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java index ea5ee06b61..259b294486 100644 --- a/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java +++ b/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java @@ -25,8 +25,6 @@ public final class ProtobufModelEventFormatter implements EventFormatterSpi { - private static final String VALIDATION_FAILED = "VALIDATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final ProtobufModelEventExFW protobufModelEventExFW = new ProtobufModelEventExFW(); @@ -49,7 +47,7 @@ public String format( case VALIDATION_FAILED: { ProtobufModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format(VALIDATION_FAILED, asString(ex.error())); + result = String.format("A message payload failed validation. %s.", asString(ex.error())); break; } } diff --git a/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufReadConverterHandler.java b/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufReadConverterHandler.java index 85470d46c0..3bdd7e336e 100644 --- a/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufReadConverterHandler.java +++ b/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufReadConverterHandler.java @@ -18,8 +18,14 @@ import java.io.IOException; import java.io.OutputStreamWriter; +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.agrona.DirectBuffer; +import org.agrona.MutableDirectBuffer; +import org.agrona.concurrent.UnsafeBuffer; import com.google.protobuf.Descriptors; import com.google.protobuf.DynamicMessage; @@ -29,11 +35,21 @@ import io.aklivity.zilla.runtime.engine.model.ConverterHandler; import io.aklivity.zilla.runtime.engine.model.function.ValueConsumer; import io.aklivity.zilla.runtime.model.protobuf.config.ProtobufModelConfig; +import io.aklivity.zilla.runtime.model.protobuf.internal.types.OctetsFW; public class ProtobufReadConverterHandler extends ProtobufModelHandler implements ConverterHandler { + private static final int TAG_TYPE_BITS = 3; + private static final String PATH = "^\\$\\.([A-Za-z_][A-Za-z0-9_]*)$"; + private static final Pattern PATH_PATTERN = Pattern.compile(PATH); + private static final DirectBuffer EMPTY_BUFFER = new UnsafeBuffer(); + + private final Matcher matcher; private final JsonFormat.Printer printer; private final OutputStreamWriter output; + private final Map extracted; + + private int progress; public ProtobufReadConverterHandler( ProtobufModelConfig config, @@ -45,6 +61,8 @@ public ProtobufReadConverterHandler( .preservingProtoFieldNames() .includingDefaultValueFields(); this.output = new OutputStreamWriter(out); + this.matcher = PATH_PATTERN.matcher(""); + this.extracted = new HashMap<>(); } @Override @@ -53,7 +71,7 @@ public int padding( int index, int length) { - int padding = 0; + int padding = handler.decodePadding(data, index, length); if (VIEW_JSON.equals(view)) { int schemaId = handler.resolve(data, index, length); @@ -64,11 +82,21 @@ public int padding( ? catalog.id : handler.resolve(subject, catalog.version); } - padding = supplyJsonFormatPadding(schemaId); + padding += supplyJsonFormatPadding(schemaId); } return padding; } + @Override + public void extract( + String path) + { + if (matcher.reset(path).matches()) + { + extracted.put(matcher.group(1), new ProtobufField()); + } + } + @Override public int convert( long traceId, @@ -78,9 +106,40 @@ public int convert( int length, ValueConsumer next) { + for (ProtobufField field: extracted.values()) + { + field.value.wrap(EMPTY_BUFFER, 0, 0); + } return handler.decode(traceId, bindingId, data, index, length, next, this::decodePayload); } + @Override + public int extractedLength( + String path) + { + OctetsFW value = null; + if (matcher.reset(path).matches()) + { + value = extracted.get(matcher.group(1)).value; + } + return value != null ? value.sizeof() : 0; + } + + @Override + public void extracted( + String path, + FieldVisitor visitor) + { + if (matcher.reset(path).matches()) + { + OctetsFW value = extracted.get(matcher.group(1)).value; + if (value != null && value.sizeof() != 0) + { + visitor.visit(value.buffer(), value.offset(), value.sizeof()); + } + } + } + private int decodePayload( long traceId, long bindingId, @@ -135,6 +194,9 @@ private int validate( break validate; } + progress = index; + extractFields(data, length, descriptor); + if (VIEW_JSON.equals(view)) { out.wrap(out.buffer()); @@ -157,4 +219,285 @@ private int validate( } return valLength; } + + private void extractFields( + DirectBuffer data, + int length, + Descriptors.Descriptor descriptor) + { + while (progress < length) + { + int lastTag = decodeVarint32(data, length) >>> TAG_TYPE_BITS; + for (Descriptors.FieldDescriptor field : descriptor.getFields()) + { + if (lastTag == field.getNumber()) + { + extract(field, data, length, extracted.get(field.getName())); + break; + } + } + } + } + + private void extract( + Descriptors.FieldDescriptor descriptor, + DirectBuffer data, + int limit, + ProtobufField field) + { + switch (descriptor.getType()) + { + case MESSAGE: + extractFields(data, limit, descriptor.getMessageType()); + break; + case BYTES: + case STRING: + int length = decodeVarint32(data, limit); + if (field != null) + { + field.value.wrap(data, progress, progress + length); + } + progress += length; + break; + case ENUM: + case UINT32: + case INT32: + int intValue = decodeVarint32(data, limit); + if (field != null) + { + MutableDirectBuffer text = field.buffer; + length = text.putIntAscii(0, intValue); + field.value.wrap(text, 0, length); + } + break; + case UINT64: + case INT64: + long longValue = decodeVarint64(data, limit); + if (field != null) + { + MutableDirectBuffer text = field.buffer; + length = text.putLongAscii(0, longValue); + field.value.wrap(text, 0, length); + } + break; + case FLOAT: + float floatValue = Float.intBitsToFloat(decodeLittleEndian32(data)); + if (field != null) + { + MutableDirectBuffer text = field.buffer; + length = text.putStringWithoutLengthAscii(0, String.valueOf(floatValue)); + field.value.wrap(text, 0, length); + } + break; + case DOUBLE: + double doubleValue = Double.longBitsToDouble(decodeLittleEndian64(data)); + if (field != null) + { + MutableDirectBuffer text = field.buffer; + length = text.putStringWithoutLengthAscii(0, String.valueOf(doubleValue)); + field.value.wrap(text, 0, length); + } + break; + case SFIXED32: + case FIXED32: + int fixed32Value = decodeLittleEndian32(data); + if (field != null) + { + MutableDirectBuffer text = field.buffer; + length = text.putIntAscii(0, fixed32Value); + field.value.wrap(text, 0, length); + } + break; + case SFIXED64: + case FIXED64: + long fixed64Value = decodeLittleEndian64(data); + if (field != null) + { + MutableDirectBuffer text = field.buffer; + length = text.putLongAscii(0, fixed64Value); + field.value.wrap(text, 0, length); + } + break; + case SINT32: + int sintValue = decodeVarint32(data, limit); + if (field != null) + { + MutableDirectBuffer text = field.buffer; + length = text.putIntAscii(0, (sintValue >>> 1) ^ - (sintValue & 1)); + field.value.wrap(text, 0, length); + } + break; + case SINT64: + long sint64Value = decodeVarint64(data, limit); + if (field != null) + { + MutableDirectBuffer text = field.buffer; + length = text.putLongAscii(0, (sint64Value >>> 1) ^ - (sint64Value & 1)); + field.value.wrap(text, 0, length); + } + break; + } + } + + public int decodeVarint32( + DirectBuffer data, + int limit) + { + int value; + boolean slow = false; + fastpath: + { + int tmpProgress = progress; + if ((value = data.getByte(tmpProgress++)) >= 0) + { + } + else if (limit - tmpProgress < 9) + { + slow = true; + break fastpath; + } + else if ((value ^= data.getByte(tmpProgress++) << 7) < 0) + { + value ^= ~0 << 7; + } + else if ((value ^= data.getByte(tmpProgress++) << 14) >= 0) + { + value ^= (~0 << 7) ^ (~0 << 14); + } + else if ((value ^= data.getByte(tmpProgress++) << 21) < 0) + { + value ^= (~0 << 7) ^ (~0 << 14) ^ (~0 << 21); + } + else + { + int y = data.getByte(tmpProgress++); + value ^= y << 28; + value ^= (~0 << 7) ^ (~0 << 14) ^ (~0 << 21) ^ (~0 << 28); + if (y < 0 && data.getByte(tmpProgress++) < 0 && + data.getByte(tmpProgress++) < 0 && data.getByte(tmpProgress++) < 0 && + data.getByte(tmpProgress++) < 0 && data.getByte(tmpProgress++) < 0) + { + slow = true; + break fastpath; + } + } + progress = tmpProgress; + } + + if (slow) + { + value = (int) decodeVarint64SlowPath(data); + } + + return value; + } + + long decodeVarint64( + DirectBuffer data, + int limit) + { + long value; + boolean slow = false; + fastpath: + { + int tmpProgress = progress; + if ((value = data.getByte(tmpProgress++)) >= 0) + { + } + else if (limit - tmpProgress < 9) + { + slow = true; + break fastpath; + } + else if ((value ^= data.getByte(tmpProgress++) << 7) < 0) + { + value = value ^ (~0 << 7); + } + else if ((value ^= data.getByte(tmpProgress++) << 14) >= 0) + { + value = value ^ ((~0 << 7) ^ (~0 << 14)); + } + else if ((value ^= data.getByte(tmpProgress++) << 21) < 0) + { + value = value ^ ((~0 << 7) ^ (~0 << 14) ^ (~0 << 21)); + } + else if ((value = value ^ data.getByte(tmpProgress++) << 28) >= 0L) + { + value ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28); + } + else if ((value ^= data.getByte(tmpProgress++) << 35) < 0L) + { + value ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28) ^ (~0L << 35); + } + else if ((value ^= data.getByte(tmpProgress++) << 42) >= 0L) + { + value ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28) ^ (~0L << 35) ^ (~0L << 42); + } + else if ((value ^= data.getByte(tmpProgress++) << 49) < 0L) + { + value ^= + (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28) ^ (~0L << 35) ^ (~0L << 42) ^ (~0L << 49); + } + else + { + value ^= data.getByte(tmpProgress++) << 56; + value ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28) ^ (~0L << 35) + ^ (~0L << 42) ^ (~0L << 49) ^ (~0L << 56); + if (value < 0L) + { + if (data.getByte(tmpProgress++) < 0L) + { + slow = true; + break fastpath; + } + } + } + progress = tmpProgress; + } + + if (slow) + { + value = decodeVarint64SlowPath(data); + } + + return value; + } + + private long decodeVarint64SlowPath( + DirectBuffer data) + { + long result = 0; + for (int shift = 0; shift < 64; shift += 7) + { + final byte b = data.getByte(progress++); + result |= (long) (b & 0x7F) << shift; + if ((b & 0x80) == 0) + { + break; + } + } + return result; + } + + private int decodeLittleEndian32( + DirectBuffer data) + { + return (data.getByte(progress++) & 0xff) | + ((data.getByte(progress++) & 0xff) << 8) | + ((data.getByte(progress++) & 0xff) << 16) | + ((data.getByte(progress++) & 0xff) << 24); + } + + long decodeLittleEndian64( + DirectBuffer data) + { + return (data.getByte(progress++) & 0xffL) | + ((data.getByte(progress++) & 0xffL) << 8) | + ((data.getByte(progress++) & 0xffL) << 16) | + ((data.getByte(progress++) & 0xffL) << 24) | + ((data.getByte(progress++) & 0xffL) << 32) | + ((data.getByte(progress++) & 0xffL) << 40) | + ((data.getByte(progress++) & 0xffL) << 48) | + ((data.getByte(progress++) & 0xffL) << 56); + } } diff --git a/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufWriteConverterHandler.java b/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufWriteConverterHandler.java index 50069f1b4b..21b8d985a0 100644 --- a/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufWriteConverterHandler.java +++ b/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufWriteConverterHandler.java @@ -58,7 +58,7 @@ public int padding( ? catalog.id : handler.resolve(subject, catalog.version); - return handler.encodePadding() + supplyIndexPadding(schemaId); + return handler.encodePadding(length) + supplyIndexPadding(schemaId); } @Override diff --git a/runtime/model-protobuf/src/test/java/io/aklivity/zilla/runtime/model/protobuf/internal/EventIT.java b/runtime/model-protobuf/src/test/java/io/aklivity/zilla/runtime/model/protobuf/internal/EventIT.java index f337a652d6..776e51855f 100644 --- a/runtime/model-protobuf/src/test/java/io/aklivity/zilla/runtime/model/protobuf/internal/EventIT.java +++ b/runtime/model-protobuf/src/test/java/io/aklivity/zilla/runtime/model/protobuf/internal/EventIT.java @@ -22,9 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; import io.aklivity.zilla.runtime.engine.test.EngineRule; import io.aklivity.zilla.runtime.engine.test.annotation.Configuration; diff --git a/runtime/model-protobuf/src/test/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelTest.java b/runtime/model-protobuf/src/test/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelTest.java index f8a1812625..7813afc5c1 100644 --- a/runtime/model-protobuf/src/test/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelTest.java +++ b/runtime/model-protobuf/src/test/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelTest.java @@ -29,6 +29,7 @@ import io.aklivity.zilla.runtime.engine.EngineContext; import io.aklivity.zilla.runtime.engine.binding.function.MessageConsumer; import io.aklivity.zilla.runtime.engine.config.CatalogConfig; +import io.aklivity.zilla.runtime.engine.model.ConverterHandler; import io.aklivity.zilla.runtime.engine.model.function.ValueConsumer; import io.aklivity.zilla.runtime.engine.test.internal.catalog.TestCatalogHandler; import io.aklivity.zilla.runtime.engine.test.internal.catalog.config.TestCatalogOptionsConfig; @@ -70,6 +71,27 @@ public class ProtobufModelTest "optional string date_time = 2;" + "}" + "}"; + + private static final String COMPLEX_SCHEMA = "syntax = \"proto3\"; " + + "package io.confluent.examples.clients.basicavro; " + + "message SimpleMessage " + + "{ " + + "double field_double = 1; " + + "float field_float = 2; " + + "int64 field_int64 = 3; " + + "uint64 field_uint64 = 4; " + + "int32 field_int32 = 5; " + + "fixed64 field_fixed64 = 6; " + + "fixed32 field_fixed32 = 7; " + + "string field_string = 8; " + + "bytes field_bytes = 9; " + + "uint32 field_uint32 = 10; " + + "sfixed32 field_sfixed32 = 12; " + + "sfixed64 field_sfixed64 = 13; " + + "sint32 field_sint32 = 14; " + + "sint64 field_sint64 = 15; " + + "}"; + private EngineContext context; @Before @@ -353,4 +375,99 @@ public void shouldVerifyIndexPaddingLength() assertEquals(3, converter.padding(data, 0, data.capacity())); } + + @Test + public void shouldExtract() + { + TestCatalogOptionsConfig testCatalogOptionsConfig = TestCatalogOptionsConfig.builder() + .id(9) + .schema(COMPLEX_SCHEMA) + .build(); + CatalogConfig catalogConfig = new CatalogConfig("test", "test0", "test", testCatalogOptionsConfig); + when(context.supplyCatalog(catalogConfig.id)).thenReturn(new TestCatalogHandler(testCatalogOptionsConfig)); + + ProtobufModelConfig config = ProtobufModelConfig.builder() + .catalog() + .name("test0") + .schema() + .strategy("topic") + .version("latest") + .subject("test-value") + .build() + .build() + .build(); + ProtobufReadConverterHandler converter = new ProtobufReadConverterHandler(config, context); + + String stringPath = "$.field_string"; + converter.extract(stringPath); + + String floatPath = "$.field_float"; + converter.extract(floatPath); + + String int64Path = "$.field_int64"; + converter.extract(int64Path); + + String int32Path = "$.field_int32"; + converter.extract(int32Path); + + String doublePath = "$.field_double"; + converter.extract(doublePath); + + String sfixed32Path = "$.field_sfixed32"; + converter.extract(sfixed32Path); + + String sint64Path = "$.field_sint64"; + converter.extract(sint64Path); + + String fixed64Path = "$.field_fixed64"; + converter.extract(fixed64Path); + + String sint32Path = "$.field_sint32"; + converter.extract(sint32Path); + + DirectBuffer data = new UnsafeBuffer(); + + byte[] bytes = {0, 9, 119, -66, -97, 26, 47, -35, 94, 64, 21, 102, -26, -11, 66, 24, -107, -102, -17, 58, + 32, -79, -47, -7, -42, 3, 40, -71, 96, 49, 21, -51, 91, 7, 0, 0, 0, 0, 61, 57, 48, 0, 0, 66, 12, 100, + 117, 109, 109, 121, 32, 115, 116, 114, 105, 110, 103, 74, 5, 1, 2, 3, 4, 5, 80, -78, -110, 4, 101, 57, + 48, 0, 0, 105, 21, -51, 91, 7, 0, 0, 0, 0, 112, -28, -92, 8, 120, -30, -94, -13, -83, 7}; + data.wrap(bytes, 0, bytes.length); + assertEquals(data.capacity() - 1, converter.convert(0L, 0L, data, 0, data.capacity(), ValueConsumer.NOP)); + + ConverterHandler.FieldVisitor visitor; + + assertEquals(12, converter.extractedLength(stringPath)); + visitor = (buffer, index, length) -> + { + assertEquals("dummy string", buffer.getStringWithoutLengthUtf8(index, length)); + }; + converter.extracted(stringPath, visitor); + + assertEquals(7, converter.extractedLength(doublePath)); + + visitor = (buffer, index, length) -> + { + assertEquals("123.456", buffer.getStringWithoutLengthUtf8(index, length)); + }; + converter.extracted(doublePath, visitor); + + visitor = (buffer, index, length) -> + { + assertEquals("12345", buffer.getStringWithoutLengthUtf8(index, length)); + }; + converter.extracted(int32Path, visitor); + + visitor = (buffer, index, length) -> + { + assertEquals("122.95", buffer.getStringWithoutLengthUtf8(index, length)); + }; + converter.extracted(floatPath, visitor); + + visitor = (buffer, index, length) -> + { + assertEquals("123456789", buffer.getStringWithoutLengthUtf8(index, length)); + }; + converter.extracted(int64Path, visitor); + + } } diff --git a/runtime/pom.xml b/runtime/pom.xml index 1321f6c3ac..69831c5e7b 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla zilla - 0.9.82 + 0.9.83 ../pom.xml @@ -40,6 +40,7 @@ binding-tls binding-ws catalog-apicurio + catalog-filesystem catalog-inline catalog-karapace common @@ -50,6 +51,7 @@ exporter-otlp exporter-prometheus exporter-stdout + filesystem-http guard-jwt metrics-grpc metrics-http @@ -179,6 +181,11 @@ catalog-apicurio ${project.version} + + ${project.groupId} + catalog-filesystem + ${project.version} + ${project.groupId} catalog-inline @@ -229,6 +236,11 @@ exporter-stdout ${project.version} + + ${project.groupId} + filesystem-http + ${project.version} + ${project.groupId} guard-jwt diff --git a/runtime/resolver-env/pom.xml b/runtime/resolver-env/pom.xml index f7ce61e05e..98049c2ef3 100644 --- a/runtime/resolver-env/pom.xml +++ b/runtime/resolver-env/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 1.00 0 diff --git a/runtime/vault-filesystem/pom.xml b/runtime/vault-filesystem/pom.xml index c678ee63db..c87fbb13a5 100644 --- a/runtime/vault-filesystem/pom.xml +++ b/runtime/vault-filesystem/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.89 0 @@ -66,13 +64,13 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test - org.kaazing - k3po.lang + io.aklivity.k3po + lang test @@ -150,7 +148,7 @@ - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/runtime/vault-filesystem/src/main/java/io/aklivity/zilla/runtime/vault/filesystem/config/FileSystemOptionsConfig.java b/runtime/vault-filesystem/src/main/java/io/aklivity/zilla/runtime/vault/filesystem/config/FileSystemOptionsConfig.java index e124c1ec23..9a6d4fe725 100644 --- a/runtime/vault-filesystem/src/main/java/io/aklivity/zilla/runtime/vault/filesystem/config/FileSystemOptionsConfig.java +++ b/runtime/vault-filesystem/src/main/java/io/aklivity/zilla/runtime/vault/filesystem/config/FileSystemOptionsConfig.java @@ -15,6 +15,8 @@ */ package io.aklivity.zilla.runtime.vault.filesystem.config; +import java.util.LinkedList; +import java.util.List; import java.util.function.Function; import io.aklivity.zilla.runtime.engine.config.OptionsConfig; @@ -41,8 +43,25 @@ public static FileSystemOptionsConfigBuilder builder( FileSystemStoreConfig trust, FileSystemStoreConfig signers) { + super(List.of(), resolveResources(keys, trust)); this.keys = keys; this.trust = trust; this.signers = signers; } + + private static List resolveResources( + FileSystemStoreConfig keys, + FileSystemStoreConfig trust) + { + List resources = new LinkedList<>(); + if (keys != null && keys.store != null) + { + resources.add(keys.store); + } + if (trust != null && trust.store != null) + { + resources.add(trust.store); + } + return resources; + } } diff --git a/runtime/vault-filesystem/src/main/java/io/aklivity/zilla/runtime/vault/filesystem/internal/FileSystemContext.java b/runtime/vault-filesystem/src/main/java/io/aklivity/zilla/runtime/vault/filesystem/internal/FileSystemContext.java index 0b303d4bc6..7b7904d5b9 100644 --- a/runtime/vault-filesystem/src/main/java/io/aklivity/zilla/runtime/vault/filesystem/internal/FileSystemContext.java +++ b/runtime/vault-filesystem/src/main/java/io/aklivity/zilla/runtime/vault/filesystem/internal/FileSystemContext.java @@ -15,7 +15,7 @@ */ package io.aklivity.zilla.runtime.vault.filesystem.internal; -import java.net.URL; +import java.nio.file.Path; import java.util.function.Function; import io.aklivity.zilla.runtime.engine.Configuration; @@ -26,7 +26,7 @@ final class FileSystemContext implements VaultContext { - private final Function resolvePath; + private final Function resolvePath; FileSystemContext( Configuration config, diff --git a/runtime/vault-filesystem/src/main/java/io/aklivity/zilla/runtime/vault/filesystem/internal/FileSystemVaultHandler.java b/runtime/vault-filesystem/src/main/java/io/aklivity/zilla/runtime/vault/filesystem/internal/FileSystemVaultHandler.java index c465063d99..80fc4d3fbc 100644 --- a/runtime/vault-filesystem/src/main/java/io/aklivity/zilla/runtime/vault/filesystem/internal/FileSystemVaultHandler.java +++ b/runtime/vault-filesystem/src/main/java/io/aklivity/zilla/runtime/vault/filesystem/internal/FileSystemVaultHandler.java @@ -16,8 +16,8 @@ package io.aklivity.zilla.runtime.vault.filesystem.internal; import java.io.InputStream; -import java.net.URL; -import java.net.URLConnection; +import java.nio.file.Files; +import java.nio.file.Path; import java.security.KeyStore; import java.security.KeyStore.Entry; import java.security.KeyStore.PrivateKeyEntry; @@ -50,7 +50,7 @@ public class FileSystemVaultHandler implements VaultHandler public FileSystemVaultHandler( FileSystemOptionsConfig options, - Function resolvePath) + Function resolvePath) { lookupKey = supplyLookupPrivateKeyEntry(resolvePath, options.keys); lookupTrust = supplyLookupTrustedCertificateEntry(resolvePath, options.trust); @@ -94,21 +94,21 @@ public PrivateKeyEntry[] keys( } private static Function supplyLookupPrivateKeyEntry( - Function resolvePath, + Function resolvePath, FileSystemStoreConfig aliases) { return supplyLookupAlias(resolvePath, aliases, FileSystemVaultHandler::lookupPrivateKeyEntry); } private static Function supplyLookupTrustedCertificateEntry( - Function resolvePath, + Function resolvePath, FileSystemStoreConfig aliases) { return supplyLookupAlias(resolvePath, aliases, FileSystemVaultHandler::lookupTrustedCertificateEntry); } private Function, KeyStore.PrivateKeyEntry[]> supplyLookupPrivateKeyEntries( - Function resolvePath, + Function resolvePath, FileSystemStoreConfig entries) { Function, KeyStore.PrivateKeyEntry[]> lookupKeys = p -> null; @@ -117,9 +117,8 @@ private Function, KeyStore.PrivateKeyEntry[]> supplyLoo { try { - URL storeURL = resolvePath.apply(entries.store); - URLConnection connection = storeURL.openConnection(); - try (InputStream input = connection.getInputStream()) + Path storePath = resolvePath.apply(entries.store); + try (InputStream input = Files.newInputStream(storePath)) { String type = Optional.ofNullable(entries.type).orElse(TYPE_DEFAULT); char[] password = Optional.ofNullable(entries.password).map(String::toCharArray).orElse(null); @@ -165,7 +164,7 @@ private Function, KeyStore.PrivateKeyEntry[]> supplyLoo } private static Function supplyLookupAlias( - Function resolvePath, + Function resolvePath, FileSystemStoreConfig aliases, Lookup lookup) { @@ -175,9 +174,8 @@ private static Function supplyLookupAlias( { try { - URL storeURL = resolvePath.apply(aliases.store); - URLConnection connection = storeURL.openConnection(); - try (InputStream input = connection.getInputStream()) + Path storePath = resolvePath.apply(aliases.store); + try (InputStream input = Files.newInputStream(storePath)) { String type = Optional.ofNullable(aliases.type).orElse(TYPE_DEFAULT); char[] password = Optional.ofNullable(aliases.password).map(String::toCharArray).orElse(null); diff --git a/runtime/vault-filesystem/src/test/java/io/aklivity/zilla/runtime/vault/filesystem/internal/FileSystemVaultTest.java b/runtime/vault-filesystem/src/test/java/io/aklivity/zilla/runtime/vault/filesystem/internal/FileSystemVaultTest.java index fecdd376f6..2f16fdcc88 100644 --- a/runtime/vault-filesystem/src/test/java/io/aklivity/zilla/runtime/vault/filesystem/internal/FileSystemVaultTest.java +++ b/runtime/vault-filesystem/src/test/java/io/aklivity/zilla/runtime/vault/filesystem/internal/FileSystemVaultTest.java @@ -20,6 +20,9 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.nullValue; +import java.net.URI; +import java.net.URL; +import java.nio.file.Path; import java.security.KeyStore.PrivateKeyEntry; import java.security.KeyStore.TrustedCertificateEntry; @@ -45,7 +48,7 @@ public void shouldResolveServer() throws Exception .build() .build(); - FileSystemVaultHandler vault = new FileSystemVaultHandler(options, FileSystemVaultTest.class::getResource); + FileSystemVaultHandler vault = new FileSystemVaultHandler(options, FileSystemVaultTest::getResourcePath); PrivateKeyEntry key = vault.key("localhost"); TrustedCertificateEntry certificate = vault.certificate("clientca"); @@ -70,7 +73,7 @@ public void shouldResolveClient() throws Exception .build() .build(); - FileSystemVaultHandler vault = new FileSystemVaultHandler(options, FileSystemVaultTest.class::getResource); + FileSystemVaultHandler vault = new FileSystemVaultHandler(options, FileSystemVaultTest::getResourcePath); PrivateKeyEntry key = vault.key("client1"); PrivateKeyEntry[] signedKeys = vault.keys("clientca"); @@ -80,4 +83,12 @@ public void shouldResolveClient() throws Exception assertThat(signedKeys.length, equalTo(1)); assertThat(signedKeys[0], not(nullValue())); } + + public static Path getResourcePath( + String resource) + { + URL url = FileSystemVaultTest.class.getResource(resource); + assert url != null; + return Path.of(URI.create(url.toString())); + } } diff --git a/specs/binding-asyncapi.spec/NOTICE b/specs/binding-asyncapi.spec/NOTICE index 7c808ecdf7..839a0d26b6 100644 --- a/specs/binding-asyncapi.spec/NOTICE +++ b/specs/binding-asyncapi.spec/NOTICE @@ -21,6 +21,7 @@ This project includes: zilla::specs::binding-mqtt-kafka.spec under Aklivity Community License Agreement zilla::specs::binding-mqtt.spec under The Apache Software License, Version 2.0 zilla::specs::binding-proxy.spec under The Apache Software License, Version 2.0 + zilla::specs::binding-sse.spec under The Apache Software License, Version 2.0 zilla::specs::binding-tcp.spec under The Apache Software License, Version 2.0 zilla::specs::binding-tls.spec under The Apache Software License, Version 2.0 zilla::specs::engine.spec under The Apache Software License, Version 2.0 diff --git a/specs/binding-asyncapi.spec/pom.xml b/specs/binding-asyncapi.spec/pom.xml index e55ef7a7ce..77a8a51f45 100644 --- a/specs/binding-asyncapi.spec/pom.xml +++ b/specs/binding-asyncapi.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -23,16 +23,14 @@ - 11 - 11 0.91 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -50,6 +48,11 @@ binding-http.spec ${project.version} + + ${project.groupId} + binding-sse.spec + ${project.version} + ${project.groupId} binding-kafka.spec @@ -76,8 +79,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -107,7 +110,7 @@ flyweight-maven-plugin ${project.version} - core http mqtt kafka asyncapi + core http sse mqtt kafka asyncapi io.aklivity.zilla.specs.binding.asyncapi.internal.types @@ -139,7 +142,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-asyncapi.spec/src/main/java/io/aklivity/zilla/specs/binding/asyncapi/AsyncapiFunctions.java b/specs/binding-asyncapi.spec/src/main/java/io/aklivity/zilla/specs/binding/asyncapi/AsyncapiFunctions.java index 440d91d71c..7967d8751f 100644 --- a/specs/binding-asyncapi.spec/src/main/java/io/aklivity/zilla/specs/binding/asyncapi/AsyncapiFunctions.java +++ b/specs/binding-asyncapi.spec/src/main/java/io/aklivity/zilla/specs/binding/asyncapi/AsyncapiFunctions.java @@ -21,10 +21,10 @@ import org.agrona.DirectBuffer; import org.agrona.MutableDirectBuffer; import org.agrona.concurrent.UnsafeBuffer; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.specs.binding.asyncapi.internal.types.OctetsFW; import io.aklivity.zilla.specs.binding.asyncapi.internal.types.stream.AsyncapiBeginExFW; diff --git a/specs/binding-asyncapi.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/binding-asyncapi.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/binding-asyncapi.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/binding-asyncapi.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/client.sse.yaml b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/client.sse.yaml new file mode 100644 index 0000000000..e006db20ed --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/client.sse.yaml @@ -0,0 +1,93 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +--- +name: test +catalogs: + catalog0: + type: test + options: + subject: eventstore + schema: | + asyncapi: 3.0.2-zilla + info: + title: AsyncAPI Eventstore + license: + name: MIT + version: 1.0.0 + servers: + plain: + host: localhost:8080 + protocol: sse + defaultContentType: application/json + + channels: + events: + address: /events + messages: + event: + $ref: '#/components/messages/event' + showEventById: + address: /events/{id} + messages: + event: + $ref: '#/components/messages/event' + + operations: + getEvents: + action: receive + channel: + $ref: '#/channels/showEventById' + + components: + schemas: + EventPayload: + type: object + properties: + id: + type: integer + minimum: 0 + description: Event id. + name: + type: string + description: Event name. + tag: + type: string + description: Tag. + messages: + Event: + name: Event + title: Event + summary: >- + Inform about Event. + contentType: application/json + payload: + $ref: '#/components/schemas/eventPayload' +bindings: + asyncapi0: + type: asyncapi + kind: client + options: + specs: + sse_api: + catalog: + catalog0: + subject: eventstore + version: latest + tcp: + host: localhost + port: + - 8080 diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/proxy.http.kafka.async.yaml b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/proxy.http.kafka.async.yaml new file mode 100644 index 0000000000..cf9a82d693 --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/proxy.http.kafka.async.yaml @@ -0,0 +1,264 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +--- +name: test +catalogs: + catalog0: + type: test + options: + id: 0 + subject: petstore + schema: | + asyncapi: 3.0.0 + info: + title: AsyncAPI Petstore + license: + name: MIT + version: 1.0.0 + servers: + plain: + host: localhost:8080 + protocol: http + protocolVersion: '2.0' + defaultContentType: application/json + + channels: + customer: + address: /customer + messages: + customer: + $ref: '#/components/messages/customer' + showCustomerById: + address: /customer;cid={correlationId} + messages: + customer: + $ref: '#/components/messages/customer' + + operations: + createCustomer: + action: send + bindings: + http: + method: POST + channel: + $ref: '#/channels/customer' + getVerifiedCustomer: + action: receive + bindings: + http: + method: GET + query: + type: object + properties: + limit: + type: number + channel: + $ref: '#/channels/showCustomerById' + + components: + correlationIds: + customerCorrelationId: + location: '$message.header#/CorrelId' + schemas: + Customer: + type: object + properties: + id: + type: integer + format: int64 + example: 100000 + username: + type: string + example: fehguy + status: + type: string + description: Verification Status + example: approved + enum: + - pending + - approved + - denied + address: + type: array + items: + $ref: "#/components/schemas/Address" + Address: + type: object + properties: + street: + type: string + example: 437 Lytton + city: + type: string + example: Palo Alto + state: + type: string + example: CA + zip: + type: string + example: "94301" + + messages: + customer: + name: Customer + title: Customer + summary: Information about a Customer. + contentType: application/json + correlationId: + $ref: '#/components/correlationIds/customerCorrelationId' + headers: + type: object + properties: + CorrelId: + type: string + format: /customer;cid={correlationId} + payload: + $ref: "#/components/schemas/Customer" + + catalog1: + type: test + options: + id: 1 + subject: sensor + schema: | + asyncapi: 3.0.0 + info: + title: Petstore Kafka API + version: 1.0.0 + defaultContentType: application/json + servers: + host-connections: + host: 'localhost:9092' + protocol: kafka-secure + description: Test broker + tags: + - name: 'kind:remote' + description: This server is a remote server. Not exposed by the application. + - name: 'visibility:private' + description: This resource is private and only available to certain users. + channels: + customers: + address: "petstore-customers" + messages: + customer: + $ref: "#/components/messages/customer" + empty: + $ref: "#/components/messages/empty" + description: The topic on which pet values may be produced and consumed. + verifiedCustomers: + address: "petstore-verified-customers" + messages: + customer: + $ref: "#/components/messages/customer" + empty: + $ref: "#/components/messages/empty" + description: The topic on which pet values may be produced and consumed. + operations: + createCustomer: + action: send + channel: + $ref: "#/channels/customers" + reply: + channel: + $ref: "#/channels/verifiedCustomers" + summary: >- + Add a pet. + messages: + - $ref: "#/channels/customers/messages/customer" + components: + correlationIds: + customerVerifyCorrelationId: + description: > + This correlation ID is used for message tracing and messages + correlation. This correlation ID is generated at runtime based on the + `VERIFY_ID` and sent to the RESPONSE message. + location: $message.header#/VERIFY_ID + messages: + empty: + name: EmptyMessage + payload: + type: "null" + customer: + name: Customer + title: Customer + summary: Information about a Customer. + contentType: application/json + payload: + $ref: "#/components/schemas/Customer" + schemas: + Customer: + type: object + properties: + id: + type: integer + format: int64 + example: 100000 + username: + type: string + example: fehguy + status: + type: string + description: Verification Status + example: approved + enum: + - pending + - approved + - denied + address: + type: array + items: + $ref: "#/components/schemas/Address" + Address: + type: object + properties: + street: + type: string + example: 437 Lytton + city: + type: string + example: Palo Alto + state: + type: string + example: CA + zip: + type: string + example: "94301" + +bindings: + asyncapi_proxy0: + type: asyncapi + kind: proxy + options: + specs: + http_api: + catalog: + catalog0: + subject: petstore + version: latest + kafka_api: + catalog: + catalog1: + subject: petstore + version: latest + routes: + - when: + - api-id: http_api + operation-id: createCustomer + exit: asyncapi_kafka0 + with: + api-id: kafka_api + operation-id: createCustomer diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/proxy.http.kafka.yaml b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/proxy.http.kafka.yaml new file mode 100644 index 0000000000..e31c9b3fdf --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/proxy.http.kafka.yaml @@ -0,0 +1,215 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +--- +name: test +catalogs: + catalog0: + type: test + options: + subject: petstore + schema: | + asyncapi: 3.0.0 + info: + title: AsyncAPI Petstore + license: + name: MIT + version: 1.0.0 + servers: + plain: + host: localhost:8080 + protocol: http + protocolVersion: '2.0' + defaultContentType: application/json + + channels: + pets: + address: /pets + messages: + pet: + $ref: '#/components/messages/pet' + showPetById: + address: /pets/{id} + messages: + pet: + $ref: '#/components/messages/pet' + + operations: + createPets: + action: send + bindings: + http: + method: POST + channel: + $ref: '#/channels/pets' + listPets: + action: receive + bindings: + http: + method: GET + channel: + $ref: '#/channels/pets' + getPets: + action: receive + bindings: + http: + method: GET + query: + type: object + properties: + limit: + type: number + channel: + $ref: '#/channels/showPetById' + + components: + schemas: + petPayload: + type: object + properties: + id: + type: integer + minimum: 0 + description: Pet id. + name: + type: string + description: Pet name. + tag: + type: string + description: Tag. + messages: + pet: + name: Pet + title: Pet + summary: >- + Inform about Pet. + contentType: application/json + payload: + $ref: '#/components/schemas/petPayload' + + catalog1: + type: test + options: + subject: petstore + schema: | + asyncapi: 3.0.0 + info: + title: Petstore Kafka API + version: 1.0.0 + defaultContentType: application/json + servers: + host-connections: + host: 'localhost:9092' + protocol: kafka-secure + description: Test broker + tags: + - name: 'kind:remote' + description: This server is a remote server. Not exposed by the application. + - name: 'visibility:private' + description: This resource is private and only available to certain users. + channels: + petstore: + address: 'petstore' + messages: + pet: + $ref: '#/components/messages/pet' + description: The topic on which pet values may be produced and consumed. + operations: + listPets: + action: receive + channel: + $ref: '#/channels/petstore' + summary: >- + List all pets. + traits: + - $ref: '#/components/operationTraits/kafka' + messages: + - $ref: '#/channels/petstore/messages/pet' + createPets: + action: send + channel: + $ref: '#/channels/petstore' + summary: >- + Create a pet. + traits: + - $ref: '#/components/operationTraits/kafka' + messages: + - $ref: '#/channels/petstore/messages/pet' + components: + messages: + pet: + name: Pet + title: Pet + summary: >- + Inform about Pet. + contentType: application/json + traits: + - $ref: '#/components/messageTraits/commonHeaders' + payload: + $ref: '#/components/schemas/petPayload' + schemas: + petPayload: + type: object + properties: + id: + type: integer + minimum: 0 + description: Pet id. + name: + type: string + description: Pet name. + tag: + type: string + description: Tag. + messageTraits: + commonHeaders: + headers: + type: object + properties: + my-app-header: + type: integer + minimum: 0 + maximum: 100 + operationTraits: + kafka: + bindings: + kafka: + clientId: + type: string + enum: + - my-app-id +bindings: + asyncapi_proxy0: + type: asyncapi + kind: proxy + options: + specs: + http_api: + catalog: + catalog0: + subject: petstore + version: latest + kafka_api: + catalog: + catalog1: + subject: petstore + version: latest + routes: + - when: + - api-id: http_api + exit: asyncapi_kafka0 + with: + api-id: kafka_api diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/proxy.mqtt.kafka.yaml b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/proxy.mqtt.kafka.yaml index 38f36f2cb5..b5167e178f 100644 --- a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/proxy.mqtt.kafka.yaml +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/proxy.mqtt.kafka.yaml @@ -20,6 +20,7 @@ catalogs: catalog0: type: test options: + id: 0 subject: smartylighting schema: | asyncapi: 3.0.0 @@ -77,6 +78,7 @@ catalogs: catalog1: type: test options: + id: 1 subject: sensor schema: | asyncapi: 3.0.0 diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/proxy.sse.kafka.yaml b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/proxy.sse.kafka.yaml new file mode 100644 index 0000000000..ce4a225e85 --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/proxy.sse.kafka.yaml @@ -0,0 +1,168 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +--- +name: test +catalogs: + catalog0: + type: test + options: + id: 1 + subject: eventstore + schema: | + asyncapi: 3.0.0 + info: + title: AsyncAPI Eventstore + license: + name: MIT + version: 1.0.0 + servers: + plain: + host: localhost:8080 + protocol: sse + defaultContentType: application/json + + channels: + events: + address: /events + messages: + event: + $ref: '#/components/messages/event' + + operations: + receiveEvents: + action: receive + channel: + $ref: '#/channels/events' + + components: + schemas: + eventPayload: + type: object + properties: + id: + type: integer + minimum: 0 + description: Event id. + name: + type: string + description: Event name. + tag: + type: string + description: Tag. + messages: + event: + name: Event + title: Event + summary: >- + Inform about Event. + contentType: application/json + payload: + $ref: '#/components/schemas/eventPayload' + catalog1: + type: test + options: + subject: eventstore + schema: | + asyncapi: 3.0.0 + info: + title: Eventstore Kafka API + version: 1.0.0 + defaultContentType: application/json + servers: + host-connections: + host: 'localhost:9092' + protocol: kafka + channels: + events: + address: 'events' + messages: + event: + $ref: '#/components/messages/event' + description: The topic on which event values may be produced and consumed. + operations: + receiveEvents: + action: receive + channel: + $ref: '#/channels/events' + summary: >- + List all events. + traits: + - $ref: '#/components/operationTraits/kafka' + messages: + - $ref: '#/channels/eventstore/messages/event' + components: + messages: + event: + name: Event + title: Event + summary: >- + Inform about Event. + contentType: application/json + traits: + - $ref: '#/components/messageTraits/commonHeaders' + payload: + $ref: '#/components/schemas/eventPayload' + schemas: + eventPayload: + type: object + properties: + id: + type: integer + minimum: 0 + description: Event id. + name: + type: string + description: Event name. + messageTraits: + commonHeaders: + headers: + type: object + properties: + my-app-header: + type: integer + minimum: 0 + maximum: 100 + operationTraits: + kafka: + bindings: + kafka: + clientId: + type: string + enum: + - my-app-id +bindings: + asyncapi_proxy0: + type: asyncapi + kind: proxy + options: + specs: + sse_api: + catalog: + catalog0: + subject: eventstore + version: latest + kafka_api: + catalog: + catalog1: + subject: eventstore + version: latest + routes: + - when: + - api-id: sse_api + exit: asyncapi_kafka0 + with: + api-id: kafka_api diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/server.http.yaml b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/server.http.yaml index 5931f33bf1..4cc7790852 100644 --- a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/server.http.yaml +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/server.http.yaml @@ -79,7 +79,7 @@ catalogs: components: correlationIds: petsCorrelationId: - location: '$message.header#/idempotency-key' + location: '$message.header#/CorrelId' schemas: petPayload: type: object @@ -101,6 +101,14 @@ catalogs: summary: >- Inform about Pet. contentType: application/json + correlationId: + $ref: '#/components/correlationIds/petsCorrelationId' + headers: + type: object + properties: + CorrelId: + type: string + format: /pets;cid={correlationId} payload: $ref: '#/components/schemas/petPayload' bindings: diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/server.sse.yaml b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/server.sse.yaml new file mode 100644 index 0000000000..6c7ea9d1db --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/config/server.sse.yaml @@ -0,0 +1,91 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +--- +name: test +catalogs: + catalog0: + type: test + options: + id: 1 + subject: eventstore + schema: | + asyncapi: 3.0.2-zilla + info: + title: AsyncAPI Eventstore + license: + name: MIT + version: 1.0.0 + servers: + plain: + host: localhost:8080 + protocol: sse + defaultContentType: application/json + + channels: + events: + address: /events + messages: + event: + $ref: '#/components/messages/event' + showEventById: + address: /events/{id} + messages: + event: + $ref: '#/components/messages/event' + + operations: + getEvents: + action: receive + channel: + $ref: '#/channels/showEventById' + + components: + schemas: + eventPayload: + type: object + properties: + id: + type: integer + minimum: 0 + description: Event id. + name: + type: string + description: Event name. + tag: + type: string + description: Tag. + messages: + event: + name: Event + title: Event + summary: >- + Inform about Event. + contentType: application/json + payload: + $ref: '#/components/schemas/eventPayload' +bindings: + composite0: + type: asyncapi + kind: server + options: + specs: + sse_api: + catalog: + catalog0: + subject: eventstore + version: latest + exit: asyncapi0 diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/schema/asyncapi.3.0.2-zilla.schema.json b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/schema/asyncapi.3.0.2-zilla.schema.json new file mode 100644 index 0000000000..3b24ad6c2f --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/schema/asyncapi.3.0.2-zilla.schema.json @@ -0,0 +1,8842 @@ +{ + "$id": "http://asyncapi.com/definitions/3.0.0/asyncapi.json", + "$schema": "http://json-schema.org/draft-07/schema", + "title": "AsyncAPI 3.0.0 schema.", + "type": "object", + "required": [ + "asyncapi", + "info" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "asyncapi": { + "type": "string", + "const": "3.0.2-zilla", + "description": "The AsyncAPI specification version of this document." + }, + "id": { + "type": "string", + "description": "A unique id representing the application.", + "format": "uri" + }, + "info": { + "$ref": "http://asyncapi.com/definitions/3.0.0/info.json" + }, + "servers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/servers.json" + }, + "defaultContentType": { + "type": "string", + "description": "Default content type to use when encoding/decoding a message's payload." + }, + "channels": { + "$ref": "http://asyncapi.com/definitions/3.0.0/channels.json" + }, + "operations": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operations.json" + }, + "components": { + "$ref": "http://asyncapi.com/definitions/3.0.0/components.json" + } + }, + "definitions": { + "http://asyncapi.com/definitions/3.0.0/specificationExtension.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json", + "description": "Any property starting with x- is valid.", + "additionalProperties": true, + "additionalItems": true + }, + "http://asyncapi.com/definitions/3.0.0/info.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/info.json", + "type": "object", + "description": "The object provides metadata about the API. The metadata can be used by the clients if needed.", + "required": [ + "version", + "title" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "title": { + "type": "string", + "description": "A unique and precise title of the API." + }, + "version": { + "type": "string", + "description": "A semantic version number of the API." + }, + "description": { + "type": "string", + "description": "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + "termsOfService": { + "type": "string", + "description": "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + "format": "uri" + }, + "contact": { + "$ref": "http://asyncapi.com/definitions/3.0.0/contact.json" + }, + "license": { + "$ref": "http://asyncapi.com/definitions/3.0.0/license.json" + }, + "tags": { + "type": "array", + "description": "A list of tags for application API documentation control. Tags can be used for logical grouping of applications.", + "items": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + }, + "uniqueItems": true + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + } + }, + "examples": [ + { + "title": "AsyncAPI Sample App", + "version": "1.0.1", + "description": "This is a sample app.", + "termsOfService": "https://asyncapi.org/terms/", + "contact": { + "name": "API Support", + "url": "https://www.asyncapi.org/support", + "email": "support@asyncapi.org" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/contact.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/contact.json", + "type": "object", + "description": "Contact information for the exposed API.", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The identifying name of the contact person/organization." + }, + "url": { + "type": "string", + "description": "The URL pointing to the contact information.", + "format": "uri" + }, + "email": { + "type": "string", + "description": "The email address of the contact person/organization.", + "format": "email" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "examples": [ + { + "name": "API Support", + "url": "https://www.example.com/support", + "email": "support@example.com" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/license.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/license.json", + "type": "object", + "required": [ + "name" + ], + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The name of the license type. It's encouraged to use an OSI compatible license." + }, + "url": { + "type": "string", + "description": "The URL pointing to the license.", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "examples": [ + { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/Reference.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/Reference.json", + "type": "object", + "description": "A simple object to allow referencing other components in the specification, internally and externally.", + "required": [ + "$ref" + ], + "properties": { + "$ref": { + "description": "The reference string.", + "$ref": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json" + } + }, + "examples": [ + { + "$ref": "#/components/schemas/Pet" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json", + "type": "string", + "format": "uri-reference" + }, + "http://asyncapi.com/definitions/3.0.0/tag.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/tag.json", + "type": "object", + "description": "Allows adding metadata to a single tag.", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the tag." + }, + "description": { + "type": "string", + "description": "A short description for the tag. CommonMark syntax can be used for rich text representation." + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "examples": [ + { + "name": "user", + "description": "User-related messages" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/externalDocs.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/externalDocs.json", + "type": "object", + "additionalProperties": false, + "description": "Allows referencing an external resource for extended documentation.", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string", + "description": "A short description of the target documentation. CommonMark syntax can be used for rich text representation." + }, + "url": { + "type": "string", + "description": "The URL for the target documentation. This MUST be in the form of an absolute URL.", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "examples": [ + { + "description": "Find more info here", + "url": "https://example.com" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/servers.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/servers.json", + "description": "An object representing multiple servers.", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/server.json" + } + ] + }, + "examples": [ + { + "development": { + "host": "localhost:5672", + "description": "Development AMQP broker.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:development", + "description": "This environment is meant for developers to run their own tests." + } + ] + }, + "staging": { + "host": "rabbitmq-staging.in.mycompany.com:5672", + "description": "RabbitMQ broker for the staging environment.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:staging", + "description": "This environment is a replica of the production environment." + } + ] + }, + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "description": "RabbitMQ broker for the production environment.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:production", + "description": "This environment is the live environment available for final users." + } + ] + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/server.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/server.json", + "type": "object", + "description": "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.", + "required": [ + "host", + "protocol" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "host": { + "type": "string", + "description": "The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." + }, + "pathname": { + "type": "string", + "description": "The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the server." + }, + "summary": { + "type": "string", + "description": "A brief summary of the server." + }, + "description": { + "type": "string", + "description": "A longer description of the server. CommonMark is allowed." + }, + "protocol": { + "type": "string", + "description": "The protocol this server supports for connection." + }, + "protocolVersion": { + "type": "string", + "description": "An optional string describing the server. CommonMark syntax MAY be used for rich text representation." + }, + "variables": { + "$ref": "http://asyncapi.com/definitions/3.0.0/serverVariables.json" + }, + "security": { + "$ref": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json" + }, + "tags": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + }, + "uniqueItems": true + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + "bindings": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" + } + ] + } + }, + "examples": [ + { + "host": "kafka.in.mycompany.com:9092", + "description": "Production Kafka broker.", + "protocol": "kafka", + "protocolVersion": "3.2" + }, + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/production", + "protocol": "amqp", + "description": "Production RabbitMQ broker (uses the `production` vhost)." + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/serverVariables.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/serverVariables.json", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/serverVariable.json" + } + ] + } + }, + "http://asyncapi.com/definitions/3.0.0/serverVariable.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/serverVariable.json", + "type": "object", + "description": "An object representing a Server Variable for server URL template substitution.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "enum": { + "type": "array", + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "default": { + "type": "string", + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied." + }, + "description": { + "type": "string", + "description": "An optional description for the server variable. CommonMark syntax MAY be used for rich text representation." + }, + "examples": { + "type": "array", + "description": "An array of examples of the server variable.", + "items": { + "type": "string" + } + } + }, + "examples": [ + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/{env}", + "protocol": "amqp", + "description": "RabbitMQ broker. Use the `env` variable to point to either `production` or `staging`.", + "variables": { + "env": { + "description": "Environment to connect to. It can be either `production` or `staging`.", + "enum": [ + "production", + "staging" + ] + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/securityRequirements.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json", + "description": "An array representing security requirements.", + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json" + } + ] + } + }, + "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json", + "description": "Defines a security scheme that can be used by the operations.", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/userPassword.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/apiKey.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/X509.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/symmetricEncryption.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/asymmetricEncryption.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/HTTPSecurityScheme.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flows.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/openIdConnect.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/SaslSecurityScheme.json" + } + ], + "examples": [ + { + "type": "userPassword" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/userPassword.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/userPassword.json", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "userPassword" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "userPassword" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/apiKey.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/apiKey.json", + "type": "object", + "required": [ + "type", + "in" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme", + "enum": [ + "apiKey" + ] + }, + "in": { + "type": "string", + "description": " The location of the API key.", + "enum": [ + "user", + "password" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "apiKey", + "in": "user" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/X509.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/X509.json", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "X509" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "X509" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/symmetricEncryption.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/symmetricEncryption.json", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "symmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "symmetricEncryption" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/asymmetricEncryption.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/asymmetricEncryption.json", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "asymmetricEncryption" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false + }, + "http://asyncapi.com/definitions/3.0.0/HTTPSecurityScheme.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/HTTPSecurityScheme.json", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/NonBearerHTTPSecurityScheme.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/BearerHTTPSecurityScheme.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/NonBearerHTTPSecurityScheme.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/NonBearerHTTPSecurityScheme.json", + "not": { + "type": "object", + "properties": { + "scheme": { + "type": "string", + "description": "A short description for security scheme.", + "enum": [ + "bearer" + ] + } + } + }, + "type": "object", + "required": [ + "scheme", + "type" + ], + "properties": { + "scheme": { + "type": "string", + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235." + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + }, + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "http" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false + }, + "http://asyncapi.com/definitions/3.0.0/BearerHTTPSecurityScheme.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/BearerHTTPSecurityScheme.json", + "type": "object", + "required": [ + "type", + "scheme" + ], + "properties": { + "scheme": { + "type": "string", + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + "enum": [ + "bearer" + ] + }, + "bearerFormat": { + "type": "string", + "description": "A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes." + }, + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "http" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false + }, + "http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json", + "type": "object", + "required": [ + "type", + "name", + "in" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "httpApiKey" + ] + }, + "name": { + "type": "string", + "description": "The name of the header, query or cookie parameter to be used." + }, + "in": { + "type": "string", + "description": "The location of the API key", + "enum": [ + "header", + "query", + "cookie" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "httpApiKey", + "name": "api_key", + "in": "header" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/oauth2Flows.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/oauth2Flows.json", + "type": "object", + "description": "Allows configuration of the supported OAuth Flows.", + "required": [ + "type", + "flows" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "oauth2" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + }, + "flows": { + "type": "object", + "properties": { + "implicit": { + "description": "Configuration for the OAuth Implicit flow.", + "allOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" + }, + { + "required": [ + "authorizationUrl", + "availableScopes" + ] + }, + { + "not": { + "required": [ + "tokenUrl" + ] + } + } + ] + }, + "password": { + "description": "Configuration for the OAuth Resource Owner Protected Credentials flow.", + "allOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" + }, + { + "required": [ + "tokenUrl", + "availableScopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "clientCredentials": { + "description": "Configuration for the OAuth Client Credentials flow.", + "allOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" + }, + { + "required": [ + "tokenUrl", + "availableScopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "authorizationCode": { + "description": "Configuration for the OAuth Authorization Code flow.", + "allOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" + }, + { + "required": [ + "authorizationUrl", + "tokenUrl", + "availableScopes" + ] + } + ] + } + }, + "additionalProperties": false + }, + "scopes": { + "type": "array", + "description": "List of the needed scope names.", + "items": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json", + "type": "object", + "description": "Configuration details for a supported OAuth Flow", + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri", + "description": "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + "tokenUrl": { + "type": "string", + "format": "uri", + "description": "The token URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + "refreshUrl": { + "type": "string", + "format": "uri", + "description": "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL." + }, + "availableScopes": { + "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json", + "description": "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, + "examples": [ + { + "authorizationUrl": "https://example.com/api/oauth/dialog", + "tokenUrl": "https://example.com/api/oauth/token", + "availableScopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "http://asyncapi.com/definitions/3.0.0/openIdConnect.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/openIdConnect.json", + "type": "object", + "required": [ + "type", + "openIdConnectUrl" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "openIdConnect" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + }, + "openIdConnectUrl": { + "type": "string", + "format": "uri", + "description": "OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL." + }, + "scopes": { + "type": "array", + "description": "List of the needed scope names. An empty array means no scopes are needed.", + "items": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false + }, + "http://asyncapi.com/definitions/3.0.0/SaslSecurityScheme.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/SaslSecurityScheme.json", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme. Valid values", + "enum": [ + "plain" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "scramSha256", + "scramSha512" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "gssapi" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json", + "type": "object", + "description": "Map describing protocol-specific definitions for a server.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "http": {}, + "sse": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/server.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/server.json" + } + } + ] + }, + "kafka": { + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/server.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/server.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/server.json" + } + } + ] + }, + "anypointmq": {}, + "nats": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/server.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/server.json" + } + } + ] + }, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json" + } + } + ] + }, + "solace": { + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/solace/0.4.0/server.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/solace/0.4.0/server.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/solace/0.3.0/server.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/solace/0.2.0/server.json" + } + } + ] + }, + "googlepubsub": {}, + "pulsar": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/server.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/server.json" + } + } + ] + } + } + }, + "http://asyncapi.com/bindings/mqtt/0.2.0/server.json": { + "$id": "http://asyncapi.com/bindings/mqtt/0.2.0/server.json", + "title": "Server Schema", + "description": "This object contains information about the server representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "clientId": { + "type": "string", + "description": "The client identifier." + }, + "cleanSession": { + "type": "boolean", + "description": "Whether to create a persistent connection or not. When 'false', the connection will be persistent. This is called clean start in MQTTv5." + }, + "lastWill": { + "type": "object", + "description": "Last Will and Testament configuration.", + "properties": { + "topic": { + "type": "string", + "description": "The topic where the Last Will and Testament message will be sent." + }, + "qos": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "description": "Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2." + }, + "message": { + "type": "string", + "description": "Last Will message." + }, + "retain": { + "type": "boolean", + "description": "Whether the broker should retain the Last Will and Testament message or not." + } + } + }, + "keepAlive": { + "type": "integer", + "description": "Interval in seconds of the longest period of time the broker and the client can endure without sending a message." + }, + "sessionExpiryInterval": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "Interval time in seconds or a Schema Object containing the definition of the interval. The broker maintains a session for a disconnected client until this interval expires." + }, + "maximumPacketSize": { + "oneOf": [ + { + "type": "integer", + "minimum": 1, + "maximum": 4294967295 + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "Number of bytes or a Schema Object representing the Maximum Packet Size the Client is willing to accept." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "clientId": "guest", + "cleanSession": true, + "lastWill": { + "topic": "/last-wills", + "qos": 2, + "message": "Guest gone offline.", + "retain": false + }, + "keepAlive": 60, + "sessionExpiryInterval": 120, + "maximumPacketSize": 1024, + "bindingVersion": "0.2.0" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/schema.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.", + "allOf": [ + { + "$ref": "http://json-schema.org/draft-07/schema#" + }, + { + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "type": "boolean" + } + ], + "default": {} + }, + "items": { + "anyOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "type": "array", + "minItems": 1, + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + } + } + ], + "default": {} + }, + "allOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + } + }, + "oneOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + } + }, + "anyOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + } + }, + "not": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + "default": {} + }, + "propertyNames": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + "contains": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + "discriminator": { + "type": "string", + "description": "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details." + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + "deprecated": { + "type": "boolean", + "description": "Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.", + "default": false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + "$id": "http://json-schema.org/draft-07/schema", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#" + } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true, + "default": [] + } + }, + "type": [ + "object", + "boolean" + ], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "minLength": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "$ref": "#" + }, + "items": { + "anyOf": [ + { + "$ref": "#" + }, + { + "$ref": "#/definitions/schemaArray" + } + ], + "default": true + }, + "maxItems": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "minItems": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { + "$ref": "#" + }, + "maxProperties": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "required": { + "$ref": "#/definitions/stringArray" + }, + "additionalProperties": { + "$ref": "#" + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#" + }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#" + }, + "propertyNames": { + "format": "regex" + }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "#" + }, + { + "$ref": "#/definitions/stringArray" + } + ] + } + }, + "propertyNames": { + "$ref": "#" + }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/simpleTypes" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/simpleTypes" + }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "contentEncoding": { + "type": "string" + }, + "if": { + "$ref": "#" + }, + "then": { + "$ref": "#" + }, + "else": { + "$ref": "#" + }, + "allOf": { + "$ref": "#/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/schemaArray" + }, + "not": { + "$ref": "#" + } + }, + "default": true + }, + "http://asyncapi.com/bindings/kafka/0.4.0/server.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.4.0/server.json", + "title": "Server Schema", + "description": "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "schemaRegistryUrl": { + "type": "string", + "description": "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + "schemaRegistryVendor": { + "type": "string", + "description": "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent", + "bindingVersion": "0.4.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/server.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.3.0/server.json", + "title": "Server Schema", + "description": "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "schemaRegistryUrl": { + "type": "string", + "description": "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + "schemaRegistryVendor": { + "type": "string", + "description": "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent", + "bindingVersion": "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/jms/0.0.1/server.json": { + "$id": "http://asyncapi.com/bindings/jms/0.0.1/server.json", + "title": "Server Schema", + "description": "This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "required": [ + "jmsConnectionFactory" + ], + "properties": { + "jmsConnectionFactory": { + "type": "string", + "description": "The classname of the ConnectionFactory implementation for the JMS Provider." + }, + "properties": { + "type": "array", + "items": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/server.json#/definitions/property" + }, + "description": "Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider." + }, + "clientID": { + "type": "string", + "description": "A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "definitions": { + "property": { + "type": "object", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of a property" + }, + "value": { + "type": [ + "string", + "boolean", + "number", + "null" + ], + "description": "The name of a property" + } + } + } + }, + "examples": [ + { + "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory", + "properties": [ + { + "name": "disableTimeStampsByDefault", + "value": false + } + ], + "clientID": "my-application-1", + "bindingVersion": "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json": { + "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json", + "title": "IBM MQ server bindings object", + "description": "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "groupId": { + "type": "string", + "description": "Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group." + }, + "ccdtQueueManagerName": { + "type": "string", + "default": "*", + "description": "The name of the IBM MQ queue manager to bind to in the CCDT file." + }, + "cipherSpec": { + "type": "string", + "description": "The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center." + }, + "multiEndpointServer": { + "type": "boolean", + "default": false, + "description": "If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required." + }, + "heartBeatInterval": { + "type": "integer", + "minimum": 0, + "maximum": 999999, + "default": 300, + "description": "The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "groupId": "PRODCLSTR1", + "cipherSpec": "ANY_TLS12_OR_HIGHER", + "bindingVersion": "0.1.0" + }, + { + "groupId": "PRODCLSTR1", + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/solace/0.4.0/server.json": { + "$id": "http://asyncapi.com/bindings/solace/0.4.0/server.json", + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "msgVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "clientName": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "description": "A unique client name to use to register to the appliance. If specified, it must be a valid Topic name, and a maximum of 160 bytes in length when encoded as UTF-8." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.4.0" + } + ] + }, + "http://asyncapi.com/bindings/solace/0.3.0/server.json": { + "$id": "http://asyncapi.com/bindings/solace/0.3.0/server.json", + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "msgVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/solace/0.2.0/server.json": { + "$id": "http://asyncapi.com/bindings/solace/0.2.0/server.json", + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "msvVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/pulsar/0.1.0/server.json": { + "$id": "http://asyncapi.com/bindings/pulsar/0.1.0/server.json", + "title": "Server Schema", + "description": "This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "tenant": { + "type": "string", + "description": "The pulsar tenant. If omitted, 'public' MUST be assumed." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "tenant": "contoso", + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/channels.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/channels.json", + "type": "object", + "description": "An object containing all the Channel Object definitions the Application MUST use during runtime.", + "additionalProperties": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" + } + ] + }, + "examples": [ + { + "userSignedUp": { + "address": "user.signedup", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/channel.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/channel.json", + "type": "object", + "description": "Describes a shared communication channel.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "address": { + "type": [ + "string", + "null" + ], + "description": "An optional string representation of this channel's address. The address is typically the \"topic name\", \"routing key\", \"event type\", or \"path\". When `null` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can't be known upfront. It MAY contain Channel Address Expressions." + }, + "messages": { + "$ref": "http://asyncapi.com/definitions/3.0.0/channelMessages.json" + }, + "parameters": { + "$ref": "http://asyncapi.com/definitions/3.0.0/parameters.json" + }, + "title": { + "type": "string", + "description": "A human-friendly title for the channel." + }, + "summary": { + "type": "string", + "description": "A brief summary of the channel." + }, + "description": { + "type": "string", + "description": "A longer description of the channel. CommonMark is allowed." + }, + "servers": { + "type": "array", + "description": "The references of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + "uniqueItems": true + }, + "tags": { + "type": "array", + "description": "A list of tags for logical grouping of channels.", + "items": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + }, + "uniqueItems": true + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + "bindings": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" + } + ] + } + }, + "examples": [ + { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/rabbitmqInProd" + }, + { + "$ref": "#/servers/rabbitmqInStaging" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/channelMessages.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/channelMessages.json", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageObject.json" + } + ] + }, + "description": "A map of the messages that will be sent to this channel by any application at any time. **Every message sent to this channel MUST be valid against one, and only one, of the message objects defined in this map.**" + }, + "http://asyncapi.com/definitions/3.0.0/messageObject.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/messageObject.json", + "type": "object", + "description": "Describes a message received on a given channel and operation.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "contentType": { + "type": "string", + "description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." + }, + "headers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" + }, + "payload": { + "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" + }, + "correlationId": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/correlationId.json" + } + ] + }, + "tags": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "description": "List of examples.", + "items": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Machine readable name of the message example." + }, + "summary": { + "type": "string", + "description": "A brief summary of the message example." + }, + "headers": { + "type": "object", + "description": "Example of the application headers. It can be of any type." + }, + "payload": { + "description": "Example of the message payload. It can be of any type." + } + } + } + }, + "bindings": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + } + ] + }, + "traits": { + "type": "array", + "description": "A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.", + "items": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageTrait.json" + }, + { + "type": "array", + "items": [ + { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageTrait.json" + } + ] + }, + { + "type": "object", + "additionalItems": true + } + ] + } + ] + } + } + }, + "examples": [ + { + "messageId": "userSignup", + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/anySchema.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/anySchema.json", + "if": { + "required": [ + "schema" + ] + }, + "then": { + "$ref": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json" + }, + "else": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + "description": "An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise." + }, + "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json", + "description": "The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).", + "if": { + "not": { + "type": "object" + } + }, + "then": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + "else": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "schemaFormat": { + "description": "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.", + "anyOf": [ + { + "type": "string" + }, + { + "description": "All the schema formats tooling MUST support", + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0" + ] + }, + { + "description": "All the schema formats tools are RECOMMENDED to support", + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0", + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0", + "application/raml+yaml;version=1.0" + ] + } + ] + }, + "schema": { + "description": "Definition of the message payload. It can be of any type but defaults to Schema Object. It MUST match the schema format defined in schemaFormat, including the encoding type. E.g., Avro should be inlined as either a YAML or JSON object instead of as a string to be parsed as YAML or JSON. Non-JSON-based schemas (e.g., Protobuf or XSD) MUST be inlined as a string." + } + }, + "allOf": [ + { + "if": { + "not": { + "description": "If no schemaFormat has been defined, default to schema or reference", + "required": [ + "schemaFormat" + ] + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + } + ] + } + } + } + }, + { + "if": { + "description": "If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats", + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + } + ] + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://json-schema.org/draft-07/schema" + } + ] + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json" + } + ] + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" + } + ] + } + } + } + } + ] + } + }, + "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json", + "type": "object", + "definitions": { + "ExternalDocumentation": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + }, + "Discriminator": { + "type": "object", + "required": [ + "propertyName" + ], + "properties": { + "propertyName": { + "type": "string" + }, + "mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "patternProperties": { + "^\\$ref$": { + "type": "string", + "format": "uri-reference" + } + } + }, + "XML": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "namespace": { + "type": "string", + "format": "uri" + }, + "prefix": { + "type": "string" + }, + "attribute": { + "type": "boolean", + "default": false + }, + "wrapped": { + "type": "boolean", + "default": false + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + } + }, + "properties": { + "title": { + "type": "string" + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "minLength": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { + "type": "integer", + "minimum": 0 + }, + "minProperties": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": false + }, + "type": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + "not": { + "oneOf": [ + { + "$ref": "#" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "allOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "oneOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "anyOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "items": { + "oneOf": [ + { + "$ref": "#" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#" + }, + { + "$ref": "#/definitions/Reference" + }, + { + "type": "boolean" + } + ], + "default": true + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + }, + "default": true, + "nullable": { + "type": "boolean", + "default": false + }, + "discriminator": { + "$ref": "#/definitions/Discriminator" + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "example": true, + "externalDocs": { + "$ref": "#/definitions/ExternalDocumentation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "xml": { + "$ref": "#/definitions/XML" + } + }, + "patternProperties": { + "^x-": true + }, + "additionalProperties": false + }, + "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json", + "definitions": { + "avroSchema": { + "title": "Avro Schema", + "description": "Root Schema", + "oneOf": [ + { + "$ref": "#/definitions/types" + } + ] + }, + "types": { + "title": "Avro Types", + "description": "Allowed Avro types", + "oneOf": [ + { + "$ref": "#/definitions/primitiveType" + }, + { + "$ref": "#/definitions/primitiveTypeWithMetadata" + }, + { + "$ref": "#/definitions/customTypeReference" + }, + { + "$ref": "#/definitions/avroRecord" + }, + { + "$ref": "#/definitions/avroEnum" + }, + { + "$ref": "#/definitions/avroArray" + }, + { + "$ref": "#/definitions/avroMap" + }, + { + "$ref": "#/definitions/avroFixed" + }, + { + "$ref": "#/definitions/avroUnion" + } + ] + }, + "primitiveType": { + "title": "Primitive Type", + "description": "Basic type primitives.", + "type": "string", + "enum": [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + "primitiveTypeWithMetadata": { + "title": "Primitive Type With Metadata", + "description": "A primitive type with metadata attached.", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/primitiveType" + } + }, + "required": [ + "type" + ] + }, + "customTypeReference": { + "title": "Custom Type", + "description": "Reference to a ComplexType", + "not": { + "$ref": "#/definitions/primitiveType" + }, + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + "avroUnion": { + "title": "Union", + "description": "A Union of types", + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema" + }, + "minItems": 1 + }, + "avroField": { + "title": "Field", + "description": "A field within a Record", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/name" + }, + "type": { + "$ref": "#/definitions/types" + }, + "doc": { + "type": "string" + }, + "default": true, + "order": { + "enum": [ + "ascending", + "descending", + "ignore" + ] + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/name" + } + } + }, + "required": [ + "name", + "type" + ] + }, + "avroRecord": { + "title": "Record", + "description": "A Record", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "record" + }, + "name": { + "$ref": "#/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/name" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/avroField" + } + } + }, + "required": [ + "type", + "name", + "fields" + ] + }, + "avroEnum": { + "title": "Enum", + "description": "An enumeration", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "enum" + }, + "name": { + "$ref": "#/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/name" + } + }, + "symbols": { + "type": "array", + "items": { + "$ref": "#/definitions/name" + } + } + }, + "required": [ + "type", + "name", + "symbols" + ] + }, + "avroArray": { + "title": "Array", + "description": "An array", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "array" + }, + "name": { + "$ref": "#/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/name" + } + }, + "items": { + "$ref": "#/definitions/types" + } + }, + "required": [ + "type", + "items" + ] + }, + "avroMap": { + "title": "Map", + "description": "A map of values", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "map" + }, + "name": { + "$ref": "#/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/name" + } + }, + "values": { + "$ref": "#/definitions/types" + } + }, + "required": [ + "type", + "values" + ] + }, + "avroFixed": { + "title": "Fixed", + "description": "A fixed sized array of bytes", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "fixed" + }, + "name": { + "$ref": "#/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/name" + } + }, + "size": { + "type": "number" + } + }, + "required": [ + "type", + "name", + "size" + ] + }, + "name": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" + }, + "namespace": { + "type": "string", + "pattern": "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + "description": "Json-Schema definition for Avro AVSC files.", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema" + } + ], + "title": "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/3.0.0/correlationId.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/correlationId.json", + "type": "object", + "description": "An object that specifies an identifier at design time that can used for message tracing and correlation.", + "required": [ + "location" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the correlation ID", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + "examples": [ + { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json", + "type": "object", + "description": "Map describing protocol-specific definitions for a message.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "http": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/http/0.2.0/message.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/http/0.2.0/message.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/http/0.3.0/message.json" + } + } + ] + }, + "ws": {}, + "amqp": { + "properties": { + "bindingVersion": { + "enum": [ + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/message.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/message.json" + } + } + ] + }, + "amqp1": {}, + "mqtt": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/message.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/message.json" + } + } + ] + }, + "kafka": { + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/message.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/message.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/message.json" + } + } + ] + }, + "anypointmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json" + } + } + ] + }, + "nats": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/message.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/message.json" + } + } + ] + }, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json" + } + } + ] + }, + "solace": {}, + "googlepubsub": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json" + } + } + ] + } + } + }, + "http://asyncapi.com/bindings/http/0.2.0/message.json": { + "$id": "http://asyncapi.com/bindings/http/0.2.0/message.json", + "title": "HTTP message bindings object", + "description": "This object contains information about the message representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "headers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "Content-Type": { + "type": "string", + "enum": [ + "application/json" + ] + } + } + }, + "bindingVersion": "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/http/0.3.0/message.json": { + "$id": "http://asyncapi.com/bindings/http/0.3.0/message.json", + "title": "HTTP message bindings object", + "description": "This object contains information about the message representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "headers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + "statusCode": { + "type": "number", + "description": "The HTTP response status code according to [RFC 9110](https://httpwg.org/specs/rfc9110.html#overview.of.status.codes). `statusCode` is only relevant for messages referenced by the [Operation Reply Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyObject), as it defines the status code for the response. In all other cases, this value can be safely ignored." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "Content-Type": { + "type": "string", + "enum": [ + "application/json" + ] + } + } + }, + "bindingVersion": "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/amqp/0.3.0/message.json": { + "$id": "http://asyncapi.com/bindings/amqp/0.3.0/message.json", + "title": "AMQP message bindings object", + "description": "This object contains information about the message representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "contentEncoding": { + "type": "string", + "description": "A MIME encoding for the message content." + }, + "messageType": { + "type": "string", + "description": "Application-specific message type." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/mqtt/0.2.0/message.json": { + "$id": "http://asyncapi.com/bindings/mqtt/0.2.0/message.json", + "title": "MQTT message bindings object", + "description": "This object contains information about the message representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "payloadFormatIndicator": { + "type": "integer", + "enum": [ + 0, + 1 + ], + "description": "1 indicates that the payload is UTF-8 encoded character data. 0 indicates that the payload format is unspecified.", + "default": 0 + }, + "correlationData": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received." + }, + "contentType": { + "type": "string", + "description": "String describing the content type of the message payload. This should not conflict with the contentType field of the associated AsyncAPI Message object." + }, + "responseTopic": { + "oneOf": [ + { + "type": "string", + "format": "uri-template", + "minLength": 1 + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "The topic (channel URI) to be used for a response message." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "bindingVersion": "0.2.0" + }, + { + "contentType": "application/json", + "correlationData": { + "type": "string", + "format": "uuid" + }, + "responseTopic": "application/responses", + "bindingVersion": "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.4.0/message.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.4.0/message.json", + "title": "Message Schema", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "key": { + "anyOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" + } + ], + "description": "The message key." + }, + "schemaIdLocation": { + "type": "string", + "description": "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + "enum": [ + "header", + "payload" + ] + }, + "schemaIdPayloadEncoding": { + "type": "string", + "description": "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + "schemaLookupStrategy": { + "type": "string", + "description": "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy", + "bindingVersion": "0.4.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "4", + "bindingVersion": "0.4.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/message.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.3.0/message.json", + "title": "Message Schema", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "key": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "The message key." + }, + "schemaIdLocation": { + "type": "string", + "description": "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + "enum": [ + "header", + "payload" + ] + }, + "schemaIdPayloadEncoding": { + "type": "string", + "description": "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + "schemaLookupStrategy": { + "type": "string", + "description": "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy", + "bindingVersion": "0.3.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "4", + "bindingVersion": "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json": { + "$id": "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json", + "title": "Anypoint MQ message bindings object", + "description": "This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "headers": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "messageId": { + "type": "string" + } + } + }, + "bindingVersion": "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/jms/0.0.1/message.json": { + "$id": "http://asyncapi.com/bindings/jms/0.0.1/message.json", + "title": "Message Schema", + "description": "This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "headers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "required": [ + "JMSMessageID" + ], + "properties": { + "JMSMessageID": { + "type": [ + "string", + "null" + ], + "description": "A unique message identifier. This may be set by your JMS Provider on your behalf." + }, + "JMSTimestamp": { + "type": "integer", + "description": "The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC." + }, + "JMSDeliveryMode": { + "type": "string", + "enum": [ + "PERSISTENT", + "NON_PERSISTENT" + ], + "default": "PERSISTENT", + "description": "Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf." + }, + "JMSPriority": { + "type": "integer", + "default": 4, + "description": "The priority of the message. This may be set by your JMS Provider on your behalf." + }, + "JMSExpires": { + "type": "integer", + "description": "The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire." + }, + "JMSType": { + "type": [ + "string", + "null" + ], + "description": "The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it." + }, + "JMSCorrelationID": { + "type": [ + "string", + "null" + ], + "description": "The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values." + }, + "JMSReplyTo": { + "type": "string", + "description": "The queue or topic that the message sender expects replies to." + } + } + }, + "bindingVersion": "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json": { + "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json", + "title": "IBM MQ message bindings object", + "description": "This object contains information about the message representation in IBM MQ.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "type": { + "type": "string", + "enum": [ + "string", + "jms", + "binary" + ], + "default": "string", + "description": "The type of the message." + }, + "headers": { + "type": "string", + "description": "Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center." + }, + "description": { + "type": "string", + "description": "Provides additional information for application developers: describes the message type or format." + }, + "expiry": { + "type": "integer", + "minimum": 0, + "default": 0, + "description": "The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "binary" + } + } + }, + { + "properties": { + "type": { + "const": "jms" + } + }, + "not": { + "required": [ + "headers" + ] + } + }, + { + "properties": { + "type": { + "const": "string" + } + }, + "not": { + "required": [ + "headers" + ] + } + } + ], + "examples": [ + { + "type": "string", + "bindingVersion": "0.1.0" + }, + { + "type": "jms", + "description": "JMS stream message", + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json": { + "$id": "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json", + "title": "Cloud Pub/Sub Channel Schema", + "description": "This object contains information about the message representation for Google Cloud Pub/Sub.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding." + }, + "attributes": { + "type": "object" + }, + "orderingKey": { + "type": "string" + }, + "schema": { + "type": "object", + "additionalItems": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + } + }, + "examples": [ + { + "schema": { + "name": "projects/your-project-id/schemas/your-avro-schema-id" + } + }, + { + "schema": { + "name": "projects/your-project-id/schemas/your-protobuf-schema-id" + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/messageTrait.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/messageTrait.json", + "type": "object", + "description": "Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "contentType": { + "type": "string", + "description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." + }, + "headers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" + }, + "correlationId": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/correlationId.json" + } + ] + }, + "tags": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "description": "List of examples.", + "items": { + "type": "object" + } + }, + "bindings": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + } + ] + } + }, + "examples": [ + { + "contentType": "application/json" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/parameters.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/parameters.json", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/parameter.json" + } + ] + }, + "description": "JSON objects describing re-usable channel parameters.", + "examples": [ + { + "address": "user/{userId}/signedup", + "parameters": { + "userId": { + "description": "Id of the user." + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/parameter.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/parameter.json", + "description": "Describes a parameter included in a channel address.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + "enum": { + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", + "type": "array", + "items": { + "type": "string" + } + }, + "default": { + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied.", + "type": "string" + }, + "examples": { + "description": "An array of examples of the parameter value.", + "type": "array", + "items": { + "type": "string" + } + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the parameter value", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + "examples": [ + { + "address": "user/{userId}/signedup", + "parameters": { + "userId": { + "description": "Id of the user.", + "location": "$message.payload#/user/id" + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json", + "type": "object", + "description": "Map describing protocol-specific definitions for a channel.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "http": {}, + "ws": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" + } + } + ] + }, + "sse": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sse/0.1.0/channel.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sse/0.1.0/channel.json" + } + } + ] + }, + "amqp": { + "properties": { + "bindingVersion": { + "enum": [ + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/channel.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/channel.json" + } + } + ] + }, + "amqp1": {}, + "mqtt": {}, + "kafka": { + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/channel.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/channel.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/channel.json" + } + } + ] + }, + "anypointmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" + } + } + ] + }, + "nats": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/channel.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/channel.json" + } + } + ] + }, + "sns": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json" + } + } + ] + }, + "sqs": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json" + } + } + ] + }, + "stomp": {}, + "redis": {}, + "ibmmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" + } + } + ] + }, + "solace": {}, + "googlepubsub": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json" + } + } + ] + }, + "pulsar": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json" + } + } + ] + } + } + }, + "http://asyncapi.com/bindings/websockets/0.1.0/channel.json": { + "$id": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json", + "title": "WebSockets channel bindings object", + "description": "When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET", + "POST" + ], + "description": "The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'." + }, + "query": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." + }, + "headers": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "method": "POST", + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/sse/0.1.0/channel.json": { + "$id": "http://asyncapi.com/bindings/sse/0.1.0/channel.json", + "title": "SSE channel bindings object", + "description": "When using Server Sent Events, the channel represents a single logical message stream flowing from server to client.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET" + ], + "description": "The HTTP method to use when establishing the request. Its value MUST be GET." + }, + "query": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." + }, + "headers": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "method": "GET", + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/amqp/0.3.0/channel.json": { + "$id": "http://asyncapi.com/bindings/amqp/0.3.0/channel.json", + "title": "AMQP channel bindings object", + "description": "This object contains information about the channel representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "is": { + "type": "string", + "enum": [ + "queue", + "routingKey" + ], + "description": "Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)." + }, + "exchange": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 255, + "description": "The name of the exchange. It MUST NOT exceed 255 characters long." + }, + "type": { + "type": "string", + "enum": [ + "topic", + "direct", + "fanout", + "default", + "headers" + ], + "description": "The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'." + }, + "durable": { + "type": "boolean", + "description": "Whether the exchange should survive broker restarts or not." + }, + "autoDelete": { + "type": "boolean", + "description": "Whether the exchange should be deleted when the last queue is unbound from it." + }, + "vhost": { + "type": "string", + "default": "/", + "description": "The virtual host of the exchange. Defaults to '/'." + } + }, + "description": "When is=routingKey, this object defines the exchange properties." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 255, + "description": "The name of the queue. It MUST NOT exceed 255 characters long." + }, + "durable": { + "type": "boolean", + "description": "Whether the queue should survive broker restarts or not." + }, + "exclusive": { + "type": "boolean", + "description": "Whether the queue should be used only by one connection or not." + }, + "autoDelete": { + "type": "boolean", + "description": "Whether the queue should be deleted when the last consumer unsubscribes." + }, + "vhost": { + "type": "string", + "default": "/", + "description": "The virtual host of the queue. Defaults to '/'." + } + }, + "description": "When is=queue, this object defines the queue properties." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "oneOf": [ + { + "properties": { + "is": { + "const": "routingKey" + } + }, + "required": [ + "exchange" + ], + "not": { + "required": [ + "queue" + ] + } + }, + { + "properties": { + "is": { + "const": "queue" + } + }, + "required": [ + "queue" + ], + "not": { + "required": [ + "exchange" + ] + } + } + ], + "examples": [ + { + "is": "routingKey", + "exchange": { + "name": "myExchange", + "type": "topic", + "durable": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.3.0" + }, + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.4.0/channel.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.4.0/channel.json", + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "topic": { + "type": "string", + "description": "Kafka topic name if different from channel name." + }, + "partitions": { + "type": "integer", + "minimum": 1, + "description": "Number of partitions configured on this topic." + }, + "replicas": { + "type": "integer", + "minimum": 1, + "description": "Number of replicas configured on this topic." + }, + "topicConfiguration": { + "description": "Topic configuration properties that are relevant for the API.", + "type": "object", + "additionalProperties": false, + "properties": { + "cleanup.policy": { + "description": "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "compact", + "delete" + ] + } + }, + "retention.ms": { + "description": "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", + "type": "integer", + "minimum": -1 + }, + "retention.bytes": { + "description": "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", + "type": "integer", + "minimum": -1 + }, + "delete.retention.ms": { + "description": "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", + "type": "integer", + "minimum": 0 + }, + "max.message.bytes": { + "description": "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.", + "type": "integer", + "minimum": 0 + } + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "topic": "my-specific-topic", + "partitions": 20, + "replicas": 3, + "bindingVersion": "0.4.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/channel.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.3.0/channel.json", + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "topic": { + "type": "string", + "description": "Kafka topic name if different from channel name." + }, + "partitions": { + "type": "integer", + "minimum": 1, + "description": "Number of partitions configured on this topic." + }, + "replicas": { + "type": "integer", + "minimum": 1, + "description": "Number of replicas configured on this topic." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "topic": "my-specific-topic", + "partitions": 20, + "replicas": 3, + "bindingVersion": "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json": { + "$id": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json", + "title": "Anypoint MQ channel bindings object", + "description": "This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "destination": { + "type": "string", + "description": "The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. Defaults to the channel name." + }, + "destinationType": { + "type": "string", + "enum": [ + "exchange", + "queue", + "fifo-queue" + ], + "default": "queue", + "description": "The type of destination. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "destination": "user-signup-exchg", + "destinationType": "exchange", + "bindingVersion": "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/jms/0.0.1/channel.json": { + "$id": "http://asyncapi.com/bindings/jms/0.0.1/channel.json", + "title": "Channel Schema", + "description": "This object contains configuration for describing a JMS queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "destination": { + "type": "string", + "description": "The destination (queue) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name according to the JMS Provider. Defaults to the channel name." + }, + "destinationType": { + "type": "string", + "enum": [ + "queue", + "fifo-queue" + ], + "default": "queue", + "description": "The type of destination. SHOULD be specified to document the messaging model (point-to-point, or strict message ordering) supported by this channel." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "destination": "user-signed-up", + "destinationType": "fifo-queue", + "bindingVersion": "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/sns/0.1.0/channel.json": { + "$id": "http://asyncapi.com/bindings/sns/0.1.0/channel.json", + "title": "Channel Schema", + "description": "This object contains information about the channel representation in SNS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "name": { + "type": "string", + "description": "The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations." + }, + "ordering": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/ordering" + }, + "policy": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the topic." + }, + "bindingVersion": { + "type": "string", + "description": "The version of this binding.", + "default": "latest" + } + }, + "required": [ + "name" + ], + "definitions": { + "ordering": { + "type": "object", + "description": "By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "type": { + "type": "string", + "description": "Defines the type of SNS Topic.", + "enum": [ + "standard", + "FIFO" + ] + }, + "contentBasedDeduplication": { + "type": "boolean", + "description": "True to turn on de-duplication of messages for a channel." + } + }, + "required": [ + "type" + ] + }, + "policy": { + "type": "object", + "description": "The security policy for the SNS Topic.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this topic", + "items": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SNS permission being allowed or denied e.g. sns:Publish", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "name": "my-sns-topic", + "policy": { + "statements": [ + { + "effect": "Allow", + "principal": "*", + "action": "SNS:Publish" + } + ] + } + } + ] + }, + "http://asyncapi.com/bindings/sqs/0.2.0/channel.json": { + "$id": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json", + "title": "Channel Schema", + "description": "This object contains information about the channel representation in SQS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "queue": { + "description": "A definition of the queue that will be used as the channel.", + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/queue" + }, + "deadLetterQueue": { + "description": "A definition of the queue that will be used for un-processable messages.", + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/queue" + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0", + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "default": "latest" + } + }, + "required": [ + "queue" + ], + "definitions": { + "queue": { + "type": "object", + "description": "A definition of a queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "name": { + "type": "string", + "description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + "fifoQueue": { + "type": "boolean", + "description": "Is this a FIFO queue?", + "default": false + }, + "deduplicationScope": { + "type": "string", + "enum": [ + "queue", + "messageGroup" + ], + "description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + "default": "queue" + }, + "fifoThroughputLimit": { + "type": "string", + "enum": [ + "perQueue", + "perMessageGroupId" + ], + "description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + "default": "perQueue" + }, + "deliveryDelay": { + "type": "integer", + "description": "The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.", + "minimum": 0, + "maximum": 15, + "default": 0 + }, + "visibilityTimeout": { + "type": "integer", + "description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + "minimum": 0, + "maximum": 43200, + "default": 30 + }, + "receiveMessageWaitTime": { + "type": "integer", + "description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + "default": 0 + }, + "messageRetentionPeriod": { + "type": "integer", + "description": "How long to retain a message on the queue in seconds, unless deleted.", + "minimum": 60, + "maximum": 1209600, + "default": 345600 + }, + "redrivePolicy": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/redrivePolicy" + }, + "policy": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the queue." + } + }, + "required": [ + "name", + "fifoQueue" + ] + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/identifier" + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + }, + "identifier": { + "type": "object", + "description": "The SQS queue to use as a dead letter queue (DLQ).", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + "policy": { + "type": "object", + "description": "The security policy for the SQS Queue", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this queue.", + "items": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "queue": { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 15, + "visibilityTimeout": 60, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 86400, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + }, + "tags": { + "owner": "AsyncAPI.NET", + "platform": "AsyncAPIOrg" + } + }, + "deadLetterQueue": { + "name": "myQueue_error", + "deliveryDelay": 0, + "visibilityTimeout": 0, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 604800 + } + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json": { + "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json", + "title": "IBM MQ channel bindings object", + "description": "This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "destinationType": { + "type": "string", + "enum": [ + "topic", + "queue" + ], + "default": "topic", + "description": "Defines the type of AsyncAPI channel." + }, + "queue": { + "type": "object", + "description": "Defines the properties of a queue.", + "properties": { + "objectName": { + "type": "string", + "maxLength": 48, + "description": "Defines the name of the IBM MQ queue associated with the channel." + }, + "isPartitioned": { + "type": "boolean", + "default": false, + "description": "Defines if the queue is a cluster queue and therefore partitioned. If 'true', a binding option MAY be specified when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center." + }, + "exclusive": { + "type": "boolean", + "default": false, + "description": "Specifies if it is recommended to open the queue exclusively." + } + }, + "required": [ + "objectName" + ] + }, + "topic": { + "type": "object", + "description": "Defines the properties of a topic.", + "properties": { + "string": { + "type": "string", + "maxLength": 10240, + "description": "The value of the IBM MQ topic string to be used." + }, + "objectName": { + "type": "string", + "maxLength": 48, + "description": "The name of the IBM MQ topic object." + }, + "durablePermitted": { + "type": "boolean", + "default": true, + "description": "Defines if the subscription may be durable." + }, + "lastMsgRetained": { + "type": "boolean", + "default": false, + "description": "Defines if the last message published will be made available to new subscriptions." + } + } + }, + "maxMsgLength": { + "type": "integer", + "minimum": 0, + "maximum": 104857600, + "description": "The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "const": "topic" + } + }, + "not": { + "required": [ + "queue" + ] + } + }, + { + "properties": { + "destinationType": { + "const": "queue" + } + }, + "required": [ + "queue" + ], + "not": { + "required": [ + "topic" + ] + } + } + ], + "examples": [ + { + "destinationType": "topic", + "topic": { + "objectName": "myTopicName" + }, + "bindingVersion": "0.1.0" + }, + { + "destinationType": "queue", + "queue": { + "objectName": "myQueueName", + "exclusive": true + }, + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json": { + "$id": "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json", + "title": "Cloud Pub/Sub Channel Schema", + "description": "This object contains information about the channel representation for Google Cloud Pub/Sub.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding." + }, + "labels": { + "type": "object" + }, + "messageRetentionDuration": { + "type": "string" + }, + "messageStoragePolicy": { + "type": "object", + "additionalProperties": false, + "properties": { + "allowedPersistenceRegions": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "schemaSettings": { + "type": "object", + "additionalItems": false, + "properties": { + "encoding": { + "type": "string" + }, + "firstRevisionId": { + "type": "string" + }, + "lastRevisionId": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "encoding", + "name" + ] + } + }, + "required": [ + "schemaSettings" + ], + "examples": [ + { + "labels": { + "label1": "value1", + "label2": "value2" + }, + "messageRetentionDuration": "86400s", + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "us-central1", + "us-east1" + ] + }, + "schemaSettings": { + "encoding": "json", + "name": "projects/your-project-id/schemas/your-schema" + } + } + ] + }, + "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json": { + "$id": "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json", + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "required": [ + "namespace", + "persistence" + ], + "properties": { + "namespace": { + "type": "string", + "description": "The namespace, the channel is associated with." + }, + "persistence": { + "type": "string", + "enum": [ + "persistent", + "non-persistent" + ], + "description": "persistence of the topic in Pulsar." + }, + "compaction": { + "type": "integer", + "minimum": 0, + "description": "Topic compaction threshold given in MB" + }, + "geo-replication": { + "type": "array", + "description": "A list of clusters the topic is replicated to.", + "items": { + "type": "string" + } + }, + "retention": { + "type": "object", + "additionalProperties": false, + "properties": { + "time": { + "type": "integer", + "minimum": 0, + "description": "Time given in Minutes. `0` = Disable message retention." + }, + "size": { + "type": "integer", + "minimum": 0, + "description": "Size given in MegaBytes. `0` = Disable message retention." + } + } + }, + "ttl": { + "type": "integer", + "description": "TTL in seconds for the specified topic" + }, + "deduplication": { + "type": "boolean", + "description": "Whether deduplication of events is enabled or not." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "namespace": "ns1", + "persistence": "persistent", + "compaction": 1000, + "retention": { + "time": 15, + "size": 1000 + }, + "ttl": 360, + "geo-replication": [ + "us-west", + "us-east" + ], + "deduplication": true, + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/operations.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/operations.json", + "type": "object", + "description": "Holds a dictionary with all the operations this application MUST implement.", + "additionalProperties": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" + } + ] + }, + "examples": [ + { + "onUserSignUp": { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/kafka" + } + ] + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/operation.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/operation.json", + "type": "object", + "description": "Describes a specific operation.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "required": [ + "action", + "channel" + ], + "properties": { + "action": { + "type": "string", + "description": "Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.", + "enum": [ + "send", + "receive" + ] + }, + "channel": { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + "messages": { + "type": "array", + "description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + }, + "reply": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationReply.json" + } + ] + }, + "traits": { + "type": "array", + "description": "A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.", + "items": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationTrait.json" + } + ] + } + }, + "title": { + "type": "string", + "description": "A human-friendly title for the operation." + }, + "summary": { + "type": "string", + "description": "A brief summary of the operation." + }, + "description": { + "type": "string", + "description": "A longer description of the operation. CommonMark is allowed." + }, + "security": { + "$ref": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json" + }, + "tags": { + "type": "array", + "description": "A list of tags for logical grouping and categorization of operations.", + "items": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + }, + "uniqueItems": true + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + "bindings": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + } + ] + } + }, + "examples": [ + { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/kafka" + } + ], + "messages": [ + { + "$ref": "/components/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "/components/messages/userSignedUpReply" + } + ] + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/operationReply.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/operationReply.json", + "type": "object", + "description": "Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "address": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json" + } + ] + }, + "channel": { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + "messages": { + "type": "array", + "description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + } + } + }, + "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json", + "type": "object", + "description": "An object that specifies where an operation has to send the reply", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "required": [ + "location" + ], + "properties": { + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the reply address.", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + "description": { + "type": "string", + "description": "An optional description of the address. CommonMark is allowed." + } + }, + "examples": [ + { + "description": "Consumer inbox", + "location": "$message.header#/replyTo" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/operationTrait.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/operationTrait.json", + "type": "object", + "description": "Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "title": { + "description": "A human-friendly title for the operation.", + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/title" + }, + "summary": { + "description": "A short summary of what the operation is about.", + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/summary" + }, + "description": { + "description": "A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.", + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/description" + }, + "security": { + "description": "A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.", + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/security" + }, + "tags": { + "description": "A list of tags for logical grouping and categorization of operations.", + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/tags" + }, + "externalDocs": { + "description": "Additional external documentation for this operation.", + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/externalDocs" + }, + "bindings": { + "description": "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + } + ] + } + }, + "examples": [ + { + "bindings": { + "amqp": { + "ack": false + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json", + "type": "object", + "description": "Map describing protocol-specific definitions for an operation.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "http": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/http/0.2.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/http/0.2.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/http/0.3.0/operation.json" + } + } + ] + }, + "ws": {}, + "amqp": { + "properties": { + "bindingVersion": { + "enum": [ + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/operation.json" + } + } + ] + }, + "amqp1": {}, + "mqtt": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json" + } + } + ] + }, + "kafka": { + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/operation.json" + } + } + ] + }, + "anypointmq": {}, + "nats": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/nats/0.1.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/nats/0.1.0/operation.json" + } + } + ] + }, + "jms": {}, + "sns": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json" + } + } + ] + }, + "sqs": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json" + } + } + ] + }, + "stomp": {}, + "redis": {}, + "ibmmq": {}, + "solace": { + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/solace/0.4.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/solace/0.4.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/solace/0.3.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/solace/0.2.0/operation.json" + } + } + ] + }, + "googlepubsub": {} + } + }, + "http://asyncapi.com/bindings/http/0.2.0/operation.json": { + "$id": "http://asyncapi.com/bindings/http/0.2.0/operation.json", + "title": "HTTP operation bindings object", + "description": "This object contains information about the operation representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + "description": "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + "query": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.2.0" + }, + { + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/http/0.3.0/operation.json": { + "$id": "http://asyncapi.com/bindings/http/0.3.0/operation.json", + "title": "HTTP operation bindings object", + "description": "This object contains information about the operation representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + "description": "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + "query": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.3.0" + }, + { + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/amqp/0.3.0/operation.json": { + "$id": "http://asyncapi.com/bindings/amqp/0.3.0/operation.json", + "title": "AMQP operation bindings object", + "description": "This object contains information about the operation representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "expiration": { + "type": "integer", + "minimum": 0, + "description": "TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero." + }, + "userId": { + "type": "string", + "description": "Identifies the user who has sent the message." + }, + "cc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The routing keys the message should be routed to at the time of publishing." + }, + "priority": { + "type": "integer", + "description": "A priority for the message." + }, + "deliveryMode": { + "type": "integer", + "enum": [ + 1, + 2 + ], + "description": "Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)." + }, + "mandatory": { + "type": "boolean", + "description": "Whether the message is mandatory or not." + }, + "bcc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Like cc but consumers will not receive this information." + }, + "timestamp": { + "type": "boolean", + "description": "Whether the message should include a timestamp or not." + }, + "ack": { + "type": "boolean", + "description": "Whether the consumer should ack the message or not." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "expiration": 100000, + "userId": "guest", + "cc": [ + "user.logs" + ], + "priority": 10, + "deliveryMode": 2, + "mandatory": false, + "bcc": [ + "external.audit" + ], + "timestamp": true, + "ack": false, + "bindingVersion": "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json": { + "$id": "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json", + "title": "MQTT operation bindings object", + "description": "This object contains information about the operation representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "qos": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "description": "Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery)." + }, + "retain": { + "type": "boolean", + "description": "Whether the broker should retain the message or not." + }, + "messageExpiryInterval": { + "oneOf": [ + { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "Lifetime of the message in seconds" + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "qos": 2, + "retain": true, + "messageExpiryInterval": 60, + "bindingVersion": "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.4.0/operation.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.4.0/operation.json", + "title": "Operation Schema", + "description": "This object contains information about the operation representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "groupId": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "Id of the consumer group." + }, + "clientId": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "Id of the consumer inside a consumer group." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.4.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/operation.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.3.0/operation.json", + "title": "Operation Schema", + "description": "This object contains information about the operation representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "groupId": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "Id of the consumer group." + }, + "clientId": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "Id of the consumer inside a consumer group." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/nats/0.1.0/operation.json": { + "$id": "http://asyncapi.com/bindings/nats/0.1.0/operation.json", + "title": "NATS operation bindings object", + "description": "This object contains information about the operation representation in NATS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "queue": { + "type": "string", + "description": "Defines the name of the queue to use. It MUST NOT exceed 255 characters.", + "maxLength": 255 + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "queue": "MyCustomQueue", + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/sns/0.1.0/operation.json": { + "$id": "http://asyncapi.com/bindings/sns/0.1.0/operation.json", + "title": "Operation Schema", + "description": "This object contains information about the operation representation in SNS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "topic": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier", + "description": "Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document." + }, + "consumers": { + "type": "array", + "description": "The protocols that listen to this topic and their endpoints.", + "items": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/consumer" + }, + "minItems": 1 + }, + "deliveryPolicy": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/deliveryPolicy", + "description": "Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer." + }, + "bindingVersion": { + "type": "string", + "description": "The version of this binding.", + "default": "latest" + } + }, + "required": [ + "consumers" + ], + "definitions": { + "identifier": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "url": { + "type": "string", + "description": "The endpoint is a URL." + }, + "email": { + "type": "string", + "description": "The endpoint is an email address." + }, + "phone": { + "type": "string", + "description": "The endpoint is a phone number." + }, + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including." + } + } + }, + "consumer": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "protocol": { + "description": "The protocol that this endpoint receives messages by.", + "type": "string", + "enum": [ + "http", + "https", + "email", + "email-json", + "sms", + "sqs", + "application", + "lambda", + "firehose" + ] + }, + "endpoint": { + "description": "The endpoint messages are delivered to.", + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier" + }, + "filterPolicy": { + "type": "object", + "description": "Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + }, + { + "type": "object" + } + ] + } + }, + "filterPolicyScope": { + "type": "string", + "description": "Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.", + "enum": [ + "MessageAttributes", + "MessageBody" + ], + "default": "MessageAttributes" + }, + "rawMessageDelivery": { + "type": "boolean", + "description": "If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body." + }, + "redrivePolicy": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/redrivePolicy" + }, + "deliveryPolicy": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/deliveryPolicy", + "description": "Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic." + }, + "displayName": { + "type": "string", + "description": "The display name to use with an SNS subscription" + } + }, + "required": [ + "protocol", + "endpoint", + "rawMessageDelivery" + ] + }, + "deliveryPolicy": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "minDelayTarget": { + "type": "integer", + "description": "The minimum delay for a retry in seconds." + }, + "maxDelayTarget": { + "type": "integer", + "description": "The maximum delay for a retry in seconds." + }, + "numRetries": { + "type": "integer", + "description": "The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries." + }, + "numNoDelayRetries": { + "type": "integer", + "description": "The number of immediate retries (with no delay)." + }, + "numMinDelayRetries": { + "type": "integer", + "description": "The number of immediate retries (with delay)." + }, + "numMaxDelayRetries": { + "type": "integer", + "description": "The number of post-backoff phase retries, with the maximum delay between retries." + }, + "backoffFunction": { + "type": "string", + "description": "The algorithm for backoff between retries.", + "enum": [ + "arithmetic", + "exponential", + "geometric", + "linear" + ] + }, + "maxReceivesPerSecond": { + "type": "integer", + "description": "The maximum number of deliveries per second, per subscription." + } + } + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier", + "description": "The SQS queue to use as a dead letter queue (DLQ)." + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + } + }, + "examples": [ + { + "topic": { + "name": "someTopic" + }, + "consumers": [ + { + "protocol": "sqs", + "endpoint": { + "name": "someQueue" + }, + "filterPolicy": { + "store": [ + "asyncapi_corp" + ], + "event": [ + { + "anything-but": "order_cancelled" + } + ], + "customer_interests": [ + "rugby", + "football", + "baseball" + ] + }, + "filterPolicyScope": "MessageAttributes", + "rawMessageDelivery": false, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 25 + }, + "deliveryPolicy": { + "minDelayTarget": 10, + "maxDelayTarget": 100, + "numRetries": 5, + "numNoDelayRetries": 2, + "numMinDelayRetries": 3, + "numMaxDelayRetries": 5, + "backoffFunction": "linear", + "maxReceivesPerSecond": 2 + } + } + ] + } + ] + }, + "http://asyncapi.com/bindings/sqs/0.2.0/operation.json": { + "$id": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json", + "title": "Operation Schema", + "description": "This object contains information about the operation representation in SQS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "queues": { + "type": "array", + "description": "Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.", + "items": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/queue" + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0", + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "default": "latest" + } + }, + "required": [ + "queues" + ], + "definitions": { + "queue": { + "type": "object", + "description": "A definition of a queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "$ref": { + "type": "string", + "description": "Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined." + }, + "name": { + "type": "string", + "description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + "fifoQueue": { + "type": "boolean", + "description": "Is this a FIFO queue?", + "default": false + }, + "deduplicationScope": { + "type": "string", + "enum": [ + "queue", + "messageGroup" + ], + "description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + "default": "queue" + }, + "fifoThroughputLimit": { + "type": "string", + "enum": [ + "perQueue", + "perMessageGroupId" + ], + "description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + "default": "perQueue" + }, + "deliveryDelay": { + "type": "integer", + "description": "The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.", + "minimum": 0, + "maximum": 15, + "default": 0 + }, + "visibilityTimeout": { + "type": "integer", + "description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + "minimum": 0, + "maximum": 43200, + "default": 30 + }, + "receiveMessageWaitTime": { + "type": "integer", + "description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + "default": 0 + }, + "messageRetentionPeriod": { + "type": "integer", + "description": "How long to retain a message on the queue in seconds, unless deleted.", + "minimum": 60, + "maximum": 1209600, + "default": 345600 + }, + "redrivePolicy": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/redrivePolicy" + }, + "policy": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the queue." + } + }, + "required": [ + "name" + ] + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/identifier" + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + }, + "identifier": { + "type": "object", + "description": "The SQS queue to use as a dead letter queue (DLQ).", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + "policy": { + "type": "object", + "description": "The security policy for the SQS Queue", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this queue.", + "items": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "queues": [ + { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 10, + "redrivePolicy": { + "deadLetterQueue": { + "name": "myQueue_error" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + } + }, + { + "name": "myQueue_error", + "deliveryDelay": 10 + } + ] + } + ] + }, + "http://asyncapi.com/bindings/solace/0.4.0/operation.json": { + "$id": "http://asyncapi.com/bindings/solace/0.4.0/operation.json", + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + }, + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + }, + "maxTtl": { + "type": "string", + "description": "The maximum TTL to apply to messages to be spooled." + }, + "maxMsgSpoolUsage": { + "type": "string", + "description": "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + }, + "timeToLive": { + "type": "integer", + "description": "Interval in milliseconds or a Schema Object containing the definition of the lifetime of the message." + }, + "priority": { + "type": "integer", + "minimum": 0, + "maximum": 255, + "description": "The valid priority value range is 0-255 with 0 as the lowest priority and 255 as the highest or a Schema Object containing the definition of the priority." + }, + "dmqEligible": { + "type": "boolean", + "description": "Set the message to be eligible to be moved to a Dead Message Queue. The default value is false." + } + }, + "examples": [ + { + "bindingVersion": "0.4.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] + }, + "http://asyncapi.com/bindings/solace/0.3.0/operation.json": { + "$id": "http://asyncapi.com/bindings/solace/0.3.0/operation.json", + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + }, + "maxTtl": { + "type": "string", + "description": "The maximum TTL to apply to messages to be spooled." + }, + "maxMsgSpoolUsage": { + "type": "string", + "description": "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "bindingVersion": "0.3.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] + }, + "http://asyncapi.com/bindings/solace/0.2.0/operation.json": { + "$id": "http://asyncapi.com/bindings/solace/0.2.0/operation.json", + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "bindingVersion": "0.2.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/components.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/components.json", + "type": "object", + "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "schemas": { + "type": "object", + "description": "An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" + } + ] + } + } + }, + "servers": { + "type": "object", + "description": "An object to hold reusable Server Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/server.json" + } + ] + } + } + }, + "channels": { + "type": "object", + "description": "An object to hold reusable Channel Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" + } + ] + } + } + }, + "serverVariables": { + "type": "object", + "description": "An object to hold reusable Server Variable Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/serverVariable.json" + } + ] + } + } + }, + "operations": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" + } + ] + } + } + }, + "messages": { + "type": "object", + "description": "An object to hold reusable Message Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageObject.json" + } + ] + } + } + }, + "securitySchemes": { + "type": "object", + "description": "An object to hold reusable Security Scheme Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json" + } + ] + } + } + }, + "parameters": { + "type": "object", + "description": "An object to hold reusable Parameter Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/parameter.json" + } + ] + } + } + }, + "correlationIds": { + "type": "object", + "description": "An object to hold reusable Correlation ID Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/correlationId.json" + } + ] + } + } + }, + "operationTraits": { + "type": "object", + "description": "An object to hold reusable Operation Trait Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationTrait.json" + } + ] + } + } + }, + "messageTraits": { + "type": "object", + "description": "An object to hold reusable Message Trait Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageTrait.json" + } + ] + } + } + }, + "replies": { + "type": "object", + "description": "An object to hold reusable Operation Reply Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationReply.json" + } + ] + } + } + }, + "replyAddresses": { + "type": "object", + "description": "An object to hold reusable Operation Reply Address Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json" + } + ] + } + } + }, + "serverBindings": { + "type": "object", + "description": "An object to hold reusable Server Bindings Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" + } + ] + } + } + }, + "channelBindings": { + "type": "object", + "description": "An object to hold reusable Channel Bindings Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" + } + ] + } + } + }, + "operationBindings": { + "type": "object", + "description": "An object to hold reusable Operation Bindings Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + } + ] + } + } + }, + "messageBindings": { + "type": "object", + "description": "An object to hold reusable Message Bindings Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + } + ] + } + } + }, + "tags": { + "type": "object", + "description": "An object to hold reusable Tag Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + } + } + }, + "externalDocs": { + "type": "object", + "description": "An object to hold reusable External Documentation Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + } + } + } + }, + "examples": [ + { + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "$ref": "path/to/user-create.avsc#/UserCreate" + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com:{port}", + "description": "RabbitMQ broker", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + }, + "port": { + "$ref": "#/components/serverVariables/port" + } + } + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider, in this example `mycompany.com`" + }, + "port": { + "enum": [ + "5671", + "5672" + ], + "default": "5672" + } + }, + "channels": { + "user/signedup": { + "subscribe": { + "message": { + "$ref": "#/components/messages/userSignUp" + } + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "description": "Multiline description of what this action does.\nHere you have another line.\n", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + } + ], + "headers": { + "type": "object", + "properties": { + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + } + } + } + ] + } + }, + "description": "!!Auto generated!! \n Do not manually edit. " +} diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/mqtt/publish.and.subscribe/client.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/mqtt/publish.and.subscribe/client.rpt index 1121c17782..99d6372e57 100644 --- a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/mqtt/publish.and.subscribe/client.rpt +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/mqtt/publish.and.subscribe/client.rpt @@ -53,11 +53,12 @@ connect await RECEIVED_SESSION_STATE write zilla:begin.ext ${asyncapi:beginEx() .typeId(zilla:id("asyncapi")) .apiId(0) + .operationId("sendEvents") .extension(mqtt:beginEx() .typeId(zilla:id("mqtt")) .publish() .clientId("client") - .topic("sensor/one") + .topic("sensors/one") .build() .build()) .build()} @@ -71,7 +72,7 @@ write zilla:data.ext ${mqtt:dataEx() .expiryInterval(15) .contentType("asyncapiMessage") .format("TEXT") - .responseTopic("sensor/one") + .responseTopic("sensors/one") .correlation("info") .build() .build()} @@ -88,11 +89,12 @@ connect await DATA_PUBLISHED write zilla:begin.ext ${asyncapi:beginEx() .typeId(zilla:id("asyncapi")) .apiId(0) + .operationId("receiveEvents") .extension(mqtt:beginEx() .typeId(zilla:id("mqtt")) .subscribe() .clientId("client") - .filter("sensor/two", 1, "AT_MOST_ONCE", "SEND_RETAINED") + .filter("sensors/two", 1, "AT_MOST_ONCE", "SEND_RETAINED") .build() .build()) .build()} diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/mqtt/publish.and.subscribe/server.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/mqtt/publish.and.subscribe/server.rpt index b61eca6eb6..a6018242ce 100644 --- a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/mqtt/publish.and.subscribe/server.rpt +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/mqtt/publish.and.subscribe/server.rpt @@ -52,11 +52,12 @@ accepted read zilla:begin.ext ${asyncapi:matchBeginEx() .typeId(zilla:id("asyncapi")) .apiId(0) + .operationId("sendEvents") .extension(mqtt:beginEx() .typeId(zilla:id("mqtt")) .publish() .clientId("client") - .topic("sensor/one") + .topic("sensors/one") .build() .build()) .build()} @@ -70,7 +71,7 @@ read zilla:data.ext ${mqtt:dataEx() .expiryInterval(15) .contentType("asyncapiMessage") .format("TEXT") - .responseTopic("sensor/one") + .responseTopic("sensors/one") .correlation("info") .build() .build()} @@ -82,11 +83,12 @@ accepted read zilla:begin.ext ${asyncapi:matchBeginEx() .typeId(zilla:id("asyncapi")) .apiId(0) + .operationId("receiveEvents") .extension(mqtt:beginEx() .typeId(zilla:id("mqtt")) .subscribe() .clientId("client") - .filter("sensor/two", 1, "AT_MOST_ONCE", "SEND_RETAINED") + .filter("sensors/two", 1, "AT_MOST_ONCE", "SEND_RETAINED") .build() .build()) .build()} diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.http.async.verify.customer/client.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.http.async.verify.customer/client.rpt new file mode 100644 index 0000000000..10c47464e7 --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.http.async.verify.customer/client.rpt @@ -0,0 +1,89 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +connect "zilla://streams/asyncapi_proxy0" + option zilla:window 8192 + option zilla:transmission "half-duplex" + +write zilla:begin.ext ${asyncapi:beginEx() + .typeId(zilla:id("asyncapi")) + .apiId(0) + .operationId("createCustomer") + .extension(http:beginEx() + .typeId(zilla:id("http")) + .header(":method", "POST") + .header(":scheme", "http") + .header(":path", "/customer") + .header(":authority", "localhost:8080") + .header("content-type", "application/json") + .header("content-length", "155") + .header("prefer", "respond-async") + .header("idempotency-key", "3f96592e-c8f1-4167-8c46-85f2aabb70a5") + .build()) + .build()} +connected + +write "{ \"id\": 100000, \"username\": \"fehguy\", \"status\": \"approved\", \"address\": [ { \"street\": \"437 Lytton\", \"city\": \"Palo Alto\", \"state\": \"CA\", \"zip\": \"94301\" } ] }" +write close + +read zilla:begin.ext ${asyncapi:matchBeginEx() + .typeId(zilla:id("asyncapi")) + .apiId(0) + .extension(http:beginEx() + .typeId(zilla:id("http")) + .header(":status", "202") + .header("content-length", "0") + .header("location", "/customer;cid=3f96592e-c8f1-4167-8c46-85f2aabb70a5-966ecfabf0fe9086ce63f615b87a6bed") + .build()) + .build()} + +read closed + +read notify RECEIVED_ASYNC_RESPONSE + +connect await RECEIVED_ASYNC_RESPONSE + "zilla://streams/asyncapi_proxy0" + option zilla:window 8192 + option zilla:transmission "half-duplex" + + +write zilla:begin.ext ${asyncapi:beginEx() + .typeId(zilla:id("asyncapi")) + .apiId(0) + .operationId("getVerifiedCustomer") + .extension(http:beginEx() + .typeId(zilla:id("http")) + .header(":method", "GET") + .header(":scheme", "http") + .header(":authority", "localhost:8080") + .header(":path", "/customer;cid=3f96592e-c8f1-4167-8c46-85f2aabb70a5-966ecfabf0fe9086ce63f615b87a6bed") + .header("prefer", "respond-async") + .build()) + .build()} +connected + +write close + +read zilla:begin.ext ${asyncapi:matchBeginEx() + .typeId(zilla:id("asyncapi")) + .apiId(0) + .extension(http:beginEx() + .typeId(zilla:id("http")) + .header(":status", "204") + .build()) + .build()} + +read closed diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.http.async.verify.customer/server.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.http.async.verify.customer/server.rpt new file mode 100644 index 0000000000..b08597d817 --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.http.async.verify.customer/server.rpt @@ -0,0 +1,88 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +accept "zilla://streams/asyncapi_proxy0" + option zilla:window 8192 + option zilla:transmission "half-duplex" +accepted + +read zilla:begin.ext ${asyncapi:beginEx() + .typeId(zilla:id("asyncapi")) + .apiId(0) + .operationId("createCustomer") + .extension(http:beginEx() + .typeId(zilla:id("http")) + .header(":method", "POST") + .header(":scheme", "http") + .header(":path", "/customer") + .header(":authority", "localhost:8080") + .header("content-type", "application/json") + .header("content-length", "155") + .header("prefer", "respond-async") + .header("idempotency-key", "3f96592e-c8f1-4167-8c46-85f2aabb70a5") + .build()) + .build()} +connected + +read "{ \"id\": 100000, \"username\": \"fehguy\", \"status\": \"approved\", \"address\": [ { \"street\": \"437 Lytton\", \"city\": \"Palo Alto\", \"state\": \"CA\", \"zip\": \"94301\" } ] }" +read closed + +write zilla:begin.ext ${asyncapi:beginEx() + .typeId(zilla:id("asyncapi")) + .apiId(0) + .operationId("createCustomer") + .extension(http:beginEx() + .typeId(zilla:id("http")) + .header(":status", "202") + .header("content-length", "0") + .header("Location", "/customer;cid=3f96592e-c8f1-4167-8c46-85f2aabb70a5-966ecfabf0fe9086ce63f615b87a6bed") + .build()) + .build()} +write flush + +write close + +accepted + +read zilla:begin.ext ${asyncapi:matchBeginEx() + .typeId(zilla:id("asyncapi")) + .apiId(0) + .operationId("getVerifiedCustomer") + .extension(http:beginEx() + .typeId(zilla:id("http")) + .header(":method", "GET") + .header(":scheme", "http") + .header(":authority", "localhost:8080") + .header(":path", "/customer;cid=3f96592e-c8f1-4167-8c46-85f2aabb70a5-966ecfabf0fe9086ce63f615b87a6bed") + .header("prefer", "respond-async") + .build()) + .build()} +connected + +read closed + +write zilla:begin.ext ${asyncapi:beginEx() + .typeId(zilla:id("asyncapi")) + .apiId(0) + .operationId("getVerifiedCustomer") + .extension(http:beginEx() + .typeId(zilla:id("http")) + .header(":status", "204") + .build()) + .build()} + +write flush +write close diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.http.create.pet/client.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.http.create.pet/client.rpt new file mode 100644 index 0000000000..b55b624bb8 --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.http.create.pet/client.rpt @@ -0,0 +1,47 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +connect "zilla://streams/asyncapi_proxy0" + option zilla:window 8192 + option zilla:transmission "half-duplex" + +write zilla:begin.ext ${asyncapi:beginEx() + .typeId(zilla:id("asyncapi")) + .apiId(0) + .operationId("createPets") + .extension(http:beginEx() + .typeId(zilla:id("http")) + .header(":method", "POST") + .header(":scheme", "http") + .header(":path", "/pets") + .header(":authority", "localhost:8080") + .header("content-type", "application/json") + .header("content-length", "39") + .build()) + .build()} +connected + +write "{\"id\": 1, \"name\": \"Dog\", \"tag\": \"test\"}" +write close + +read zilla:begin.ext ${asyncapi:matchBeginEx() + .typeId(zilla:id("asyncapi")) + .apiId(0) + .extension(http:beginEx() + .typeId(zilla:id("http")) + .header(":status", "204") + .build()) + .build()} diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.http.create.pet/server.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.http.create.pet/server.rpt new file mode 100644 index 0000000000..e13782ead4 --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.http.create.pet/server.rpt @@ -0,0 +1,51 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +accept "zilla://streams/asyncapi_proxy0" + option zilla:window 8192 + option zilla:transmission "half-duplex" +accepted + +read zilla:begin.ext ${openapi:beginEx() + .typeId(zilla:id("openapi")) + .apiId(0) + .operationId("createPets") + .extension(http:beginEx() + .typeId(zilla:id("http")) + .header(":method", "POST") + .header(":scheme", "http") + .header(":path", "/pets") + .header(":authority", "localhost:8080") + .header("content-type", "application/json") + .header("content-length", "39") + .build()) + .build()} + +connected + +read "{\"id\": 1, \"name\": \"Dog\", \"tag\": \"test\"}" +read closed + +write zilla:begin.ext ${openapi:beginEx() + .typeId(zilla:id("openapi")) + .apiId(0) + .operationId("createPets") + .extension(http:beginEx() + .typeId(zilla:id("http")) + .header(":status", "204") + .build()) + .build()} +write flush diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.async.verify.customer/client.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.async.verify.customer/client.rpt new file mode 100644 index 0000000000..c9ffa4d1ce --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.async.verify.customer/client.rpt @@ -0,0 +1,135 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +property deltaMillis 0L +property newTimestamp ${kafka:timestamp() + deltaMillis} + +connect "zilla://streams/asyncapi_kafka0" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${asyncapi:beginEx() + .typeId(zilla:id("asyncapi")) + .apiId(1) + .extension(kafka:beginEx() + .typeId(zilla:id("kafka")) + .merged() + .capabilities("PRODUCE_ONLY") + .topic("petstore-customers") + .partition(-1, -2) + .ackMode("IN_SYNC_REPLICAS") + .build() + .build()) + .build()} + +connected + +write option zilla:flags "init" +write zilla:data.ext ${kafka:dataEx() + .typeId(zilla:id("kafka")) + .merged() + .produce() + .timestamp(newTimestamp) + .partition(-1, -1) + .build() + .build()} +write zilla:data.empty +write flush + +write option zilla:flags "none" +write "{ \"id\": 100000, \"username\": \"fehguy\", \"status\": \"approved\", \"address\": [ { \"street\": \"437 Lytton\", \"city\": \"Palo Alto\", \"state\": \"CA\", \"zip\": \"94301\" } ] }" +write flush + +write notify SEND_ASYNC_REQUEST + +write option zilla:flags "fin" +write zilla:data.empty +write flush + +write close +read closed + +write notify SENT_ASYNC_REQUEST + +connect await SENT_ASYNC_REQUEST + "zilla://streams/asyncapi_kafka0" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${asyncapi:beginEx() + .typeId(zilla:id("asyncapi")) + .apiId(1) + .extension(kafka:beginEx() + .typeId(zilla:id("kafka")) + .merged() + .capabilities("FETCH_ONLY") + .topic("petstore-verified-customers") + .partition(-1, -2) + .filter() + .header("zilla:correlation-id", "3f96592e-c8f1-4167-8c46-85f2aabb70a5-966ecfabf0fe9086ce63f615b87a6bed") + .build() + .build() + .build()) + .build()} + +connected + +read advised zilla:flush + +read notify RECEIVED_ASYNC_FLUSH + +read closed +write close + +connect await RECEIVED_ASYNC_FLUSH + "zilla://streams/asyncapi_kafka0" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${asyncapi:beginEx() + .typeId(zilla:id("asyncapi")) + .apiId(1) + .extension(kafka:beginEx() + .typeId(zilla:id("kafka")) + .merged() + .capabilities("FETCH_ONLY") + .topic("petstore-verified-customers") + .partition(-1, -2) + .filter() + .header("zilla:correlation-id", "3f96592e-c8f1-4167-8c46-85f2aabb70a5-966ecfabf0fe9086ce63f615b87a6bed") + .build() + .build() + .build()) + .build()} + +connected + +read zilla:data.ext ${kafka:matchDataEx() + .typeId(zilla:id("kafka")) + .merged() + .fetch() + .partition(0, 1, 2) + .progress(0, 2) + .progress(1, 1) + .key("92d0bf92-63e0-4cfc-ae73-71dee92d1544") + .header(":status", "204") + .header("zilla:correlation-id", "3f96592e-c8f1-4167-8c46-85f2aabb70a5-966ecfabf0fe9086ce63f615b87a6bed") + .build() + .build()} +read zilla:data.null + +read closed +write close diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.async.verify.customer/server.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.async.verify.customer/server.rpt new file mode 100644 index 0000000000..a7446fa1b0 --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.async.verify.customer/server.rpt @@ -0,0 +1,122 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +accept "zilla://streams/asyncapi_kafka0" + option zilla:window 8192 + option zilla:transmission "duplex" + +accepted + +read zilla:begin.ext ${asyncapi:matchBeginEx() + .typeId(zilla:id("asyncapi")) + .apiId(1) + .extension(kafka:beginEx() + .typeId(zilla:id("kafka")) + .merged() + .capabilities("PRODUCE_ONLY") + .topic("petstore-customers") + .partition(-1, -2) + .ackMode("IN_SYNC_REPLICAS") + .build() + .build()) + .build()} + +connected + +read option zilla:flags "init" +read zilla:data.ext ${kafka:matchDataEx() + .typeId(zilla:id("kafka")) + .merged() + .produce() + .partition(-1, -1) + .build() + .build()} +read zilla:data.empty + +read option zilla:flags "none" +read "{ \"id\": 100000, \"username\": \"fehguy\", \"status\": \"approved\", \"address\": [ { \"street\": \"437 Lytton\", \"city\": \"Palo Alto\", \"state\": \"CA\", \"zip\": \"94301\" } ] }" + +read await SEND_ASYNC_REQUEST + +read option zilla:flags "fin" +read zilla:data.empty + +read closed +write close + +accepted + +read zilla:begin.ext ${asyncapi:matchBeginEx() + .typeId(zilla:id("asyncapi")) + .apiId(1) + .extension(kafka:beginEx() + .typeId(zilla:id("kafka")) + .merged() + .capabilities("FETCH_ONLY") + .topic("petstore-verified-customers") + .partition(-1, -2) + .filter() + .header("zilla:correlation-id", "3f96592e-c8f1-4167-8c46-85f2aabb70a5-966ecfabf0fe9086ce63f615b87a6bed") + .build() + .build() + .build()) + .build()} + +connected + +write advise zilla:flush + +write notify SEND_ASYNC_REQUEST + +write close +read closed + +accepted + +read zilla:begin.ext ${asyncapi:matchBeginEx() + .typeId(zilla:id("asyncapi")) + .apiId(1) + .extension(kafka:beginEx() + .typeId(zilla:id("kafka")) + .merged() + .capabilities("FETCH_ONLY") + .topic("petstore-verified-customers") + .partition(-1, -2) + .filter() + .header("zilla:correlation-id", "3f96592e-c8f1-4167-8c46-85f2aabb70a5-966ecfabf0fe9086ce63f615b87a6bed") + .build() + .build() + .build()) + .build()} + +connected + +write zilla:data.ext ${kafka:dataEx() + .typeId(zilla:id("kafka")) + .merged() + .fetch() + .partition(0, 1, 2) + .progress(0, 2) + .progress(1, 1) + .key("92d0bf92-63e0-4cfc-ae73-71dee92d1544") + .header(":status", "204") + .header("zilla:correlation-id", "3f96592e-c8f1-4167-8c46-85f2aabb70a5-966ecfabf0fe9086ce63f615b87a6bed") + .build() + .build()} +write flush + +write close +read closed diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.create.pet/client.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.create.pet/client.rpt new file mode 100644 index 0000000000..c4f0de4bd3 --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.create.pet/client.rpt @@ -0,0 +1,61 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +property deltaMillis 0L +property newTimestamp ${kafka:timestamp() + deltaMillis} + +connect "zilla://streams/asyncapi_kafka0" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${asyncapi:beginEx() + .typeId(zilla:id("asyncapi")) + .apiId(0) + .extension(kafka:beginEx() + .typeId(zilla:id("kafka")) + .merged() + .capabilities("PRODUCE_ONLY") + .topic("petstore") + .partition(-1, -2) + .ackMode("IN_SYNC_REPLICAS") + .build() + .build()) + .build()} + +connected + +write option zilla:flags "init" +write zilla:data.ext ${kafka:dataEx() + .typeId(zilla:id("kafka")) + .merged() + .produce() + .timestamp(newTimestamp) + .partition(-1, -1) + .build() + .build()} +write zilla:data.empty +write flush + +write option zilla:flags "none" +write "{\"id\": 1, \"name\": \"Dog\", \"tag\": \"test\"}" +write flush + +write option zilla:flags "fin" +write zilla:data.empty +write flush + +write close +read closed diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.create.pet/server.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.create.pet/server.rpt new file mode 100644 index 0000000000..69f3faf594 --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.create.pet/server.rpt @@ -0,0 +1,56 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +accept "zilla://streams/asyncapi_kafka0" + option zilla:window 8192 + option zilla:transmission "duplex" + +accepted + +read zilla:begin.ext ${asyncapi:matchBeginEx() + .typeId(zilla:id("asyncapi")) + .apiId(0) + .extension(kafka:beginEx() + .typeId(zilla:id("kafka")) + .merged() + .capabilities("PRODUCE_ONLY") + .topic("petstore") + .partition(-1, -2) + .ackMode("IN_SYNC_REPLICAS") + .build() + .build()) + .build()} + +connected + +read option zilla:flags "init" +read zilla:data.ext ${kafka:matchDataEx() + .typeId(zilla:id("kafka")) + .merged() + .produce() + .partition(-1, -1) + .build() + .build()} +read zilla:data.empty + +read option zilla:flags "none" +read "{\"id\": 1, \"name\": \"Dog\", \"tag\": \"test\"}" + +read option zilla:flags "fin" +read zilla:data.empty + +read closed +write close diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.publish/client.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.publish/client.rpt index 786dfa0ab5..617ea5df67 100644 --- a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.publish/client.rpt +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.publish/client.rpt @@ -23,7 +23,7 @@ connect "zilla://streams/asyncapi_kafka0" write zilla:begin.ext ${asyncapi:beginEx() .typeId(zilla:id("asyncapi")) - .apiId(0) + .apiId(1) .extension(kafka:beginEx() .typeId(zilla:id("kafka")) .merged() @@ -52,7 +52,7 @@ connect "zilla://streams/asyncapi_kafka0" write zilla:begin.ext ${asyncapi:beginEx() .typeId(zilla:id("asyncapi")) - .apiId(0) + .apiId(1) .extension(kafka:beginEx() .typeId(zilla:id("kafka")) .merged() diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.publish/server.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.publish/server.rpt index 4df2e9588b..7acdfa40f5 100644 --- a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.publish/server.rpt +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.publish/server.rpt @@ -22,7 +22,7 @@ accepted read zilla:begin.ext ${asyncapi:matchBeginEx() .typeId(zilla:id("asyncapi")) - .apiId(0) + .apiId(1) .extension(kafka:beginEx() .typeId(zilla:id("kafka")) .merged() @@ -49,7 +49,7 @@ accepted read zilla:begin.ext ${asyncapi:matchBeginEx() .typeId(zilla:id("asyncapi")) - .apiId(0) + .apiId(1) .extension(kafka:beginEx() .typeId(zilla:id("kafka")) .merged() diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.server.sent.messages/client.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.server.sent.messages/client.rpt new file mode 100644 index 0000000000..c60a20520f --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.server.sent.messages/client.rpt @@ -0,0 +1,64 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +connect "zilla://streams/kafka0" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${kafka:beginEx() + .typeId(zilla:id("kafka")) + .merged() + .capabilities("FETCH_ONLY") + .topic("test") + .partition(-1, -2) + .build() + .build()} + +connected + +read zilla:data.ext ${kafka:matchDataEx() + .typeId(zilla:id("kafka")) + .merged() + .fetch() + .partition(0, 1, 2) + .progress(0, 2) + .progress(1, 1) + .key("key") + .header("header", "value") + .build() + .build()} +read "Hello, world" + +read zilla:data.ext ${kafka:matchDataEx() + .typeId(zilla:id("kafka")) + .merged() + .fetch() + .partition(0, 2, 2) + .progress(0, 3) + .progress(1, 1) + .key("key") + .header("header", "value") + .build() + .build()} +read "Hello, again" + +read advised zilla:flush ${kafka:matchFlushEx() + .typeId(zilla:id("kafka")) + .merged() + .fetch() + .progress(0, 2, 2, 2) + .build() + .build()} diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.server.sent.messages/server.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.server.sent.messages/server.rpt new file mode 100644 index 0000000000..d6090439ac --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.kafka.server.sent.messages/server.rpt @@ -0,0 +1,74 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +accept "zilla://streams/asyncapi_kafka0" + option zilla:window 8192 + option zilla:transmission "duplex" + +accepted + +read zilla:begin.ext ${asyncapi:matchBeginEx() + .typeId(zilla:id("asyncapi")) + .apiId(0) + .extension(kafka:beginEx() + .typeId(zilla:id("kafka")) + .merged() + .capabilities("FETCH_ONLY") + .topic("events") + .partition(-1, -2) + .build() + .build()) + .build()} + +connected + +write zilla:data.ext ${kafka:dataEx() + .typeId(zilla:id("kafka")) + .merged() + .fetch() + .timestamp(kafka:timestamp()) + .partition(0, 1, 2) + .progress(0, 2) + .progress(1, 1) + .key("key") + .header("header", "value") + .build() + .build()} +write "Hello, world" +write flush + +write zilla:data.ext ${kafka:dataEx() + .typeId(zilla:id("kafka")) + .merged() + .fetch() + .timestamp(kafka:timestamp()) + .partition(0, 2, 2) + .progress(0, 3) + .progress(1, 1) + .key("key") + .header("header", "value") + .build() + .build()} +write "Hello, again" +write flush + +write advise zilla:flush ${kafka:flushEx() + .typeId(zilla:id("kafka")) + .merged() + .fetch() + .progress(0, 2, 2, 2) + .build() + .build()} diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.mqtt.publish/client.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.mqtt.publish/client.rpt index 4b4a496017..ef03075957 100644 --- a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.mqtt.publish/client.rpt +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.mqtt.publish/client.rpt @@ -22,6 +22,7 @@ connect await WILL_STREAM_STARTED write zilla:begin.ext ${asyncapi:beginEx() .typeId(zilla:id("asyncapi")) .apiId(0) + .operationId("sendEvents") .extension(mqtt:beginEx() .typeId(zilla:id("mqtt")) .publish() diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.mqtt.publish/server.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.mqtt.publish/server.rpt index 464d15bf24..4555bdb728 100644 --- a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.mqtt.publish/server.rpt +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.mqtt.publish/server.rpt @@ -23,6 +23,7 @@ accepted read zilla:begin.ext ${asyncapi:matchBeginEx() .typeId(zilla:id("asyncapi")) .apiId(0) + .operationId("sendEvents") .extension(mqtt:beginEx() .typeId(zilla:id("mqtt")) .publish() diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.sse.server.sent.messages/client.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.sse.server.sent.messages/client.rpt new file mode 100644 index 0000000000..0764b589fe --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.sse.server.sent.messages/client.rpt @@ -0,0 +1,47 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +connect "zilla://streams/asyncapi_proxy0" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${asyncapi:beginEx() + .typeId(zilla:id("asyncapi")) + .apiId(0) + .operationId("receiveEvents") + .extension(sse:beginEx() + .typeId(zilla:id("sse")) + .scheme("http") + .authority("localhost:8080") + .path("/events") + .lastId(null) + .build()) + .build()} +connected + +read zilla:data.ext ${sse:matchDataEx() + .typeId(zilla:id("sse")) + .id("AQQABAIC") + .type(null) + .build()} +read "Hello, world" + +read zilla:data.ext ${sse:matchDataEx() + .typeId(zilla:id("sse")) + .id("AQQABgIC") + .type(null) + .build()} +read "Hello, again" diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.sse.server.sent.messages/server.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.sse.server.sent.messages/server.rpt new file mode 100644 index 0000000000..8dc923e458 --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/proxy.sse.server.sent.messages/server.rpt @@ -0,0 +1,44 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +accept "zilla://streams/sse0" + option zilla:window 8192 + option zilla:transmission "duplex" +accepted + +read zilla:begin.ext ${sse:beginEx() + .typeId(zilla:id("sse")) + .scheme("http") + .authority("localhost:8080") + .path("/test") + .lastId(null) + .build()} + +connected + +write flush + +write zilla:data.ext ${sse:dataEx() + .typeId(zilla:id("sse")) + .id("AQQABAIC") + .build()} +write "Hello, world" + +write zilla:data.ext ${sse:dataEx() + .typeId(zilla:id("sse")) + .id("AQQABgIC") + .build()} +write "Hello, again" diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/sse/data.multiple/client.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/sse/data.multiple/client.rpt new file mode 100644 index 0000000000..8d7f3a727a --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/sse/data.multiple/client.rpt @@ -0,0 +1,37 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +connect "zilla://streams/asyncapi0" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${asyncapi:beginEx() + .typeId(zilla:id("asyncapi")) + .apiId(1) + .operationId("getEvents") + .extension(sse:beginEx() + .typeId(zilla:id("sse")) + .scheme("http") + .authority("localhost:8080") + .path("/events/a8b7c6d5") + .lastId(null) + .build()) + .build()} +connected + +read "Hello, world" + +read "Hello, again" diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/sse/data.multiple/server.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/sse/data.multiple/server.rpt new file mode 100644 index 0000000000..a543efde2a --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/sse/data.multiple/server.rpt @@ -0,0 +1,39 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +accept "zilla://streams/asyncapi0" + option zilla:window 8192 + option zilla:transmission "duplex" + +accepted + +read zilla:begin.ext ${asyncapi:matchBeginEx() + .typeId(zilla:id("asyncapi")) + .apiId(1) + .operationId("getEvents") + .extension(sse:beginEx() + .typeId(zilla:id("sse")) + .scheme("http") + .authority("localhost:8080") + .path("/events/a8b7c6d5") + .lastId(null) + .build()) + .build()} +connected + +write "Hello, world" + +write "Hello, again" diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/mqtt/publish.and.subscribe/client.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/mqtt/publish.and.subscribe/client.rpt index 0d625cf82a..698525586f 100644 --- a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/mqtt/publish.and.subscribe/client.rpt +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/mqtt/publish.and.subscribe/client.rpt @@ -49,7 +49,7 @@ write zilla:begin.ext ${mqtt:beginEx() .typeId(zilla:id("mqtt")) .publish() .clientId("client") - .topic("sensor/one") + .topic("sensors/one") .build() .build()} @@ -62,7 +62,7 @@ write zilla:data.ext ${mqtt:dataEx() .expiryInterval(15) .contentType("asyncapiMessage") .format("TEXT") - .responseTopic("sensor/one") + .responseTopic("sensors/one") .correlation("info") .build() .build()} @@ -81,7 +81,7 @@ write zilla:begin.ext ${mqtt:beginEx() .typeId(zilla:id("mqtt")) .subscribe() .clientId("client") - .filter("sensor/two", 1, "AT_MOST_ONCE", "SEND_RETAINED") + .filter("sensors/two", 1, "AT_MOST_ONCE", "SEND_RETAINED") .build() .build()} diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/mqtt/publish.and.subscribe/server.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/mqtt/publish.and.subscribe/server.rpt index dc22830300..8f60c29426 100644 --- a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/mqtt/publish.and.subscribe/server.rpt +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/mqtt/publish.and.subscribe/server.rpt @@ -48,7 +48,7 @@ read zilla:begin.ext ${mqtt:matchBeginEx() .typeId(zilla:id("mqtt")) .publish() .clientId("client") - .topic("sensor/one") + .topic("sensors/one") .build() .build()} @@ -61,7 +61,7 @@ read zilla:data.ext ${mqtt:matchDataEx() .expiryInterval(15) .contentType("asyncapiMessage") .format("TEXT") - .responseTopic("sensor/one") + .responseTopic("sensors/one") .correlation("info") .build() .build()} @@ -75,7 +75,7 @@ read zilla:begin.ext ${mqtt:matchBeginEx() .typeId(zilla:id("mqtt")) .subscribe() .clientId("client") - .filter("sensor/two", 1, "AT_MOST_ONCE", "SEND_RETAINED") + .filter("sensors/two", 1, "AT_MOST_ONCE", "SEND_RETAINED") .build() .build()} diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/sse/data.multiple/client.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/sse/data.multiple/client.rpt new file mode 100644 index 0000000000..21c0be5f20 --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/sse/data.multiple/client.rpt @@ -0,0 +1,34 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +connect "zilla://streams/composite0" + option zilla:window 8192 + option zilla:transmission "duplex" + option zilla:ephemeral "test:composite0/sse_api" + +write zilla:begin.ext ${sse:beginEx() + .typeId(zilla:id("sse")) + .scheme("http") + .authority("localhost:8080") + .path("/events/a8b7c6d5") + .lastId(null) + .build()} + +connected + +read "Hello, world" + +read "Hello, again" diff --git a/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/sse/data.multiple/server.rpt b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/sse/data.multiple/server.rpt new file mode 100644 index 0000000000..4f203872fe --- /dev/null +++ b/specs/binding-asyncapi.spec/src/main/scripts/io/aklivity/zilla/specs/binding/asyncapi/streams/sse/data.multiple/server.rpt @@ -0,0 +1,39 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +property serverAddress "zilla://streams/composite0" + +accept ${serverAddress} + option zilla:window 8192 + option zilla:transmission "duplex" + +accepted + +read zilla:begin.ext ${sse:beginEx() + .typeId(zilla:id("sse")) + .scheme("http") + .authority("localhost:8080") + .path("/events/a8b7c6d5") + .lastId(null) + .build()} + +connected + +write "Hello, world" +write flush + +write "Hello, again" +write flush diff --git a/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/AsyncapiFunctionsTest.java b/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/AsyncapiFunctionsTest.java index 44ab1567fd..f2a10191c4 100644 --- a/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/AsyncapiFunctionsTest.java +++ b/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/AsyncapiFunctionsTest.java @@ -24,8 +24,8 @@ import org.agrona.MutableDirectBuffer; import org.agrona.concurrent.UnsafeBuffer; import org.junit.Test; -import org.kaazing.k3po.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; import io.aklivity.zilla.specs.binding.asyncapi.internal.types.OctetsFW; import io.aklivity.zilla.specs.binding.asyncapi.internal.types.stream.AsyncapiBeginExFW; diff --git a/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/HttpIT.java b/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/HttpIT.java index a12163b237..f4b7b9d011 100644 --- a/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/HttpIT.java +++ b/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/HttpIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class HttpIT { diff --git a/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/KafkaIT.java b/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/KafkaIT.java index 9e43d077af..107edeac07 100644 --- a/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/KafkaIT.java +++ b/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/KafkaIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class KafkaIT { diff --git a/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/MqttIT.java b/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/MqttIT.java index 51ac9a8bec..6a0efab33f 100644 --- a/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/MqttIT.java +++ b/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/MqttIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class MqttIT { diff --git a/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/SseIT.java b/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/SseIT.java new file mode 100644 index 0000000000..44ffe83015 --- /dev/null +++ b/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/SseIT.java @@ -0,0 +1,49 @@ +/* + * Copyright 2021-2023 Aklivity Inc. + * + * Aklivity licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.aklivity.zilla.specs.binding.asyncapi.streams; + +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.rules.RuleChain.outerRule; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.DisableOnDebug; +import org.junit.rules.TestRule; +import org.junit.rules.Timeout; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; + +public class SseIT +{ + private final K3poRule k3po = new K3poRule() + .addScriptRoot("sse", "io/aklivity/zilla/specs/binding/asyncapi/streams/sse"); + + private final TestRule timeout = new DisableOnDebug(new Timeout(5, SECONDS)); + + @Rule + public final TestRule chain = outerRule(k3po).around(timeout); + + @Test + @Specification({ + "${sse}/data.multiple/client", + "${sse}/data.multiple/server" + }) + public void shouldReceiveMultipleData() throws Exception + { + k3po.finish(); + } +} diff --git a/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/AsyncapiIT.java b/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/AsyncapiIT.java index ab9158f3bf..63e5427111 100644 --- a/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/AsyncapiIT.java +++ b/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/asyncapi/AsyncapiIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AsyncapiIT { @@ -56,6 +57,16 @@ public void shouldCreatePet() throws Exception k3po.finish(); } + @Test + @Specification({ + "${asyncapi}/sse/data.multiple/client", + "${asyncapi}/sse/data.multiple/server" + }) + public void shouldReceiveMultipleData() throws Exception + { + k3po.finish(); + } + @Test @Specification({ "${asyncapi}/kafka/produce.message/client", diff --git a/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/http/HttpIT.java b/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/http/HttpIT.java index ccddb26bbd..4afdd89ac9 100644 --- a/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/http/HttpIT.java +++ b/specs/binding-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/asyncapi/streams/http/HttpIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class HttpIT { diff --git a/specs/binding-echo.spec/pom.xml b/specs/binding-echo.spec/pom.xml index 9a0bd6567c..0e578fb49c 100644 --- a/specs/binding-echo.spec/pom.xml +++ b/specs/binding-echo.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -110,7 +108,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-echo.spec/src/test/java/io/aklivity/zilla/specs/binding/echo/streams/rfc862/ServerIT.java b/specs/binding-echo.spec/src/test/java/io/aklivity/zilla/specs/binding/echo/streams/rfc862/ServerIT.java index 9e9ad2701c..03c641e633 100644 --- a/specs/binding-echo.spec/src/test/java/io/aklivity/zilla/specs/binding/echo/streams/rfc862/ServerIT.java +++ b/specs/binding-echo.spec/src/test/java/io/aklivity/zilla/specs/binding/echo/streams/rfc862/ServerIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ServerIT { diff --git a/specs/binding-fan.spec/pom.xml b/specs/binding-fan.spec/pom.xml index ddb07be7c4..4cc8225ef2 100644 --- a/specs/binding-fan.spec/pom.xml +++ b/specs/binding-fan.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -108,7 +106,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-fan.spec/src/test/java/io/aklivity/zilla/specs/binding/fan/streams/ApplicationIT.java b/specs/binding-fan.spec/src/test/java/io/aklivity/zilla/specs/binding/fan/streams/ApplicationIT.java index b64d09f302..9b96d795e0 100644 --- a/specs/binding-fan.spec/src/test/java/io/aklivity/zilla/specs/binding/fan/streams/ApplicationIT.java +++ b/specs/binding-fan.spec/src/test/java/io/aklivity/zilla/specs/binding/fan/streams/ApplicationIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ApplicationIT { diff --git a/specs/binding-fan.spec/src/test/java/io/aklivity/zilla/specs/binding/fan/streams/NetworkIT.java b/specs/binding-fan.spec/src/test/java/io/aklivity/zilla/specs/binding/fan/streams/NetworkIT.java index 2096135319..7e65a5dfdf 100644 --- a/specs/binding-fan.spec/src/test/java/io/aklivity/zilla/specs/binding/fan/streams/NetworkIT.java +++ b/specs/binding-fan.spec/src/test/java/io/aklivity/zilla/specs/binding/fan/streams/NetworkIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class NetworkIT { diff --git a/specs/binding-filesystem.spec/pom.xml b/specs/binding-filesystem.spec/pom.xml index e86490b6ac..c95a74d9b1 100644 --- a/specs/binding-filesystem.spec/pom.xml +++ b/specs/binding-filesystem.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -115,7 +113,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-filesystem.spec/src/main/java/io/aklivity/zilla/specs/binding/filesystem/internal/FileSystemFunctions.java b/specs/binding-filesystem.spec/src/main/java/io/aklivity/zilla/specs/binding/filesystem/internal/FileSystemFunctions.java index 5430745152..1b970303d6 100644 --- a/specs/binding-filesystem.spec/src/main/java/io/aklivity/zilla/specs/binding/filesystem/internal/FileSystemFunctions.java +++ b/specs/binding-filesystem.spec/src/main/java/io/aklivity/zilla/specs/binding/filesystem/internal/FileSystemFunctions.java @@ -20,10 +20,10 @@ import org.agrona.DirectBuffer; import org.agrona.MutableDirectBuffer; import org.agrona.concurrent.UnsafeBuffer; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.specs.binding.filesystem.internal.types.FileSystemCapabilities; import io.aklivity.zilla.specs.binding.filesystem.internal.types.stream.FileSystemBeginExFW; diff --git a/specs/binding-filesystem.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/binding-filesystem.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/binding-filesystem.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/binding-filesystem.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/binding-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/filesystem/internal/FileSystemFunctionsTest.java b/specs/binding-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/filesystem/internal/FileSystemFunctionsTest.java index 662e23107a..ef47994a13 100644 --- a/specs/binding-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/filesystem/internal/FileSystemFunctionsTest.java +++ b/specs/binding-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/filesystem/internal/FileSystemFunctionsTest.java @@ -30,9 +30,9 @@ import org.agrona.DirectBuffer; import org.agrona.concurrent.UnsafeBuffer; import org.junit.Test; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.internal.el.ExpressionContext; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.internal.el.ExpressionContext; import io.aklivity.zilla.specs.binding.filesystem.internal.types.stream.FileSystemBeginExFW; public class FileSystemFunctionsTest diff --git a/specs/binding-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/filesystem/streams/application/FileSystemIT.java b/specs/binding-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/filesystem/streams/application/FileSystemIT.java index f61420e338..89c03a8df5 100644 --- a/specs/binding-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/filesystem/streams/application/FileSystemIT.java +++ b/specs/binding-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/filesystem/streams/application/FileSystemIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class FileSystemIT { diff --git a/specs/binding-grpc-kafka.spec/pom.xml b/specs/binding-grpc-kafka.spec/pom.xml index ceaf9538ea..61b2398c9e 100644 --- a/specs/binding-grpc-kafka.spec/pom.xml +++ b/specs/binding-grpc-kafka.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -52,8 +50,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -115,7 +113,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-grpc-kafka.spec/src/main/java/io/aklivity/zilla/specs/binding/grpc/kafka/internal/GrpcKafkaFunctions.java b/specs/binding-grpc-kafka.spec/src/main/java/io/aklivity/zilla/specs/binding/grpc/kafka/internal/GrpcKafkaFunctions.java index aee00ea9a8..6c1d1f2979 100644 --- a/specs/binding-grpc-kafka.spec/src/main/java/io/aklivity/zilla/specs/binding/grpc/kafka/internal/GrpcKafkaFunctions.java +++ b/specs/binding-grpc-kafka.spec/src/main/java/io/aklivity/zilla/specs/binding/grpc/kafka/internal/GrpcKafkaFunctions.java @@ -17,9 +17,9 @@ import org.agrona.MutableDirectBuffer; import org.agrona.concurrent.UnsafeBuffer; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.specs.binding.grpc.kafka.internal.types.GrpcKafkaMessageFieldFW; import io.aklivity.zilla.specs.binding.grpc.kafka.internal.types.GrpcKafkaMessageFieldPartitionV1FW; diff --git a/specs/binding-grpc-kafka.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/binding-grpc-kafka.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/binding-grpc-kafka.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/binding-grpc-kafka.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/internal/GrpcKafkaFunctionsTest.java b/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/internal/GrpcKafkaFunctionsTest.java index 171447f76f..99a0048ae5 100644 --- a/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/internal/GrpcKafkaFunctionsTest.java +++ b/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/internal/GrpcKafkaFunctionsTest.java @@ -26,8 +26,8 @@ import org.agrona.DirectBuffer; import org.agrona.concurrent.UnsafeBuffer; import org.junit.Test; -import org.kaazing.k3po.lang.internal.el.ExpressionContext; +import io.aklivity.k3po.runtime.lang.internal.el.ExpressionContext; import io.aklivity.zilla.specs.binding.grpc.kafka.internal.types.GrpcKafkaMessageFieldFW; import io.aklivity.zilla.specs.binding.grpc.kafka.internal.types.GrpcKafkaMessageFieldPartitionV1FW; diff --git a/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/GrpcFetchIT.java b/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/GrpcFetchIT.java index b5b29b8088..93b640f55b 100644 --- a/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/GrpcFetchIT.java +++ b/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/GrpcFetchIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class GrpcFetchIT { diff --git a/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/GrpcProduceIT.java b/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/GrpcProduceIT.java index 5c17345390..9ea88ee218 100644 --- a/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/GrpcProduceIT.java +++ b/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/GrpcProduceIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class GrpcProduceIT { diff --git a/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/KafkaFetchIT.java b/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/KafkaFetchIT.java index d0643b921a..e9b8d78633 100644 --- a/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/KafkaFetchIT.java +++ b/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/KafkaFetchIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class KafkaFetchIT { diff --git a/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/KafkaProduceIT.java b/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/KafkaProduceIT.java index dda2d2bdcf..12fc97d7cd 100644 --- a/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/KafkaProduceIT.java +++ b/specs/binding-grpc-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/kafka/streams/KafkaProduceIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class KafkaProduceIT { diff --git a/specs/binding-grpc.spec/pom.xml b/specs/binding-grpc.spec/pom.xml index 2faf749c96..96d3cc4de4 100644 --- a/specs/binding-grpc.spec/pom.xml +++ b/specs/binding-grpc.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 0.97 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -110,7 +108,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-grpc.spec/src/main/java/io/aklivity/zilla/specs/binding/grpc/internal/GrpcFunctions.java b/specs/binding-grpc.spec/src/main/java/io/aklivity/zilla/specs/binding/grpc/internal/GrpcFunctions.java index d070c2383a..f31186e95b 100644 --- a/specs/binding-grpc.spec/src/main/java/io/aklivity/zilla/specs/binding/grpc/internal/GrpcFunctions.java +++ b/specs/binding-grpc.spec/src/main/java/io/aklivity/zilla/specs/binding/grpc/internal/GrpcFunctions.java @@ -26,10 +26,10 @@ import org.agrona.MutableDirectBuffer; import org.agrona.collections.MutableBoolean; import org.agrona.concurrent.UnsafeBuffer; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.specs.binding.grpc.internal.types.OctetsFW; import io.aklivity.zilla.specs.binding.grpc.internal.types.stream.GrpcAbortExFW; import io.aklivity.zilla.specs.binding.grpc.internal.types.stream.GrpcBeginExFW; diff --git a/specs/binding-grpc.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/binding-grpc.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/binding-grpc.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/binding-grpc.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/internal/GrpcFunctionsTest.java b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/internal/GrpcFunctionsTest.java index 014121b9a6..5295818147 100644 --- a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/internal/GrpcFunctionsTest.java +++ b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/internal/GrpcFunctionsTest.java @@ -31,9 +31,9 @@ import org.agrona.DirectBuffer; import org.agrona.concurrent.UnsafeBuffer; import org.junit.Test; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.internal.el.ExpressionContext; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.internal.el.ExpressionContext; import io.aklivity.zilla.specs.binding.grpc.internal.types.OctetsFW; import io.aklivity.zilla.specs.binding.grpc.internal.types.stream.GrpcAbortExFW; import io.aklivity.zilla.specs.binding.grpc.internal.types.stream.GrpcBeginExFW; diff --git a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/BidiStreamRpcIT.java b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/BidiStreamRpcIT.java index a63df368be..a9eae66f11 100644 --- a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/BidiStreamRpcIT.java +++ b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/BidiStreamRpcIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class BidiStreamRpcIT { diff --git a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/ClientStreamRpcIT.java b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/ClientStreamRpcIT.java index 63dc02a350..f6d511e5da 100644 --- a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/ClientStreamRpcIT.java +++ b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/ClientStreamRpcIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ClientStreamRpcIT { diff --git a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/ServerStreamRpcIT.java b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/ServerStreamRpcIT.java index 311a74fd47..29687ca45a 100644 --- a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/ServerStreamRpcIT.java +++ b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/ServerStreamRpcIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ServerStreamRpcIT { diff --git a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/UnaryRpcIT.java b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/UnaryRpcIT.java index 88a92f1ae9..788ab78bae 100644 --- a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/UnaryRpcIT.java +++ b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/application/UnaryRpcIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class UnaryRpcIT { diff --git a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/BidiStreamRpcIT.java b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/BidiStreamRpcIT.java index ce0113597d..652d488689 100644 --- a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/BidiStreamRpcIT.java +++ b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/BidiStreamRpcIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class BidiStreamRpcIT diff --git a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/ClientStreamRpcIT.java b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/ClientStreamRpcIT.java index 3eca0634bb..477cdcece2 100644 --- a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/ClientStreamRpcIT.java +++ b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/ClientStreamRpcIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ClientStreamRpcIT { diff --git a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/RejectedRpcIT.java b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/RejectedRpcIT.java index ab67b3ca4b..0aff0b1487 100644 --- a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/RejectedRpcIT.java +++ b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/RejectedRpcIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class RejectedRpcIT { diff --git a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/ServerStreamRpcIT.java b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/ServerStreamRpcIT.java index 11fc876408..a34ce0a3cf 100644 --- a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/ServerStreamRpcIT.java +++ b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/ServerStreamRpcIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ServerStreamRpcIT { diff --git a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/UnaryRpcIT.java b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/UnaryRpcIT.java index 311eeaa74a..92b912a4d2 100644 --- a/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/UnaryRpcIT.java +++ b/specs/binding-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/grpc/streams/network/UnaryRpcIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class UnaryRpcIT diff --git a/specs/binding-http-filesystem.spec/pom.xml b/specs/binding-http-filesystem.spec/pom.xml index 5773c02598..a8d5cae8e6 100644 --- a/specs/binding-http-filesystem.spec/pom.xml +++ b/specs/binding-http-filesystem.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -52,8 +50,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -98,7 +96,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-http-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/http/filesystem/streams/FileSystemIT.java b/specs/binding-http-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/http/filesystem/streams/FileSystemIT.java index 06afe2244b..fb947815d6 100644 --- a/specs/binding-http-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/http/filesystem/streams/FileSystemIT.java +++ b/specs/binding-http-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/http/filesystem/streams/FileSystemIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class FileSystemIT { diff --git a/specs/binding-http-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/http/filesystem/streams/HttpIT.java b/specs/binding-http-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/http/filesystem/streams/HttpIT.java index 70c011abb3..6904d704c5 100644 --- a/specs/binding-http-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/http/filesystem/streams/HttpIT.java +++ b/specs/binding-http-filesystem.spec/src/test/java/io/aklivity/zilla/specs/binding/http/filesystem/streams/HttpIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class HttpIT { diff --git a/specs/binding-http-kafka.spec/pom.xml b/specs/binding-http-kafka.spec/pom.xml index fef29183a9..a124d9f1d9 100644 --- a/specs/binding-http-kafka.spec/pom.xml +++ b/specs/binding-http-kafka.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -52,8 +50,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -115,7 +113,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-http-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/http/kafka/streams/HttpIT.java b/specs/binding-http-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/http/kafka/streams/HttpIT.java index a310ce06d2..5361658666 100644 --- a/specs/binding-http-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/http/kafka/streams/HttpIT.java +++ b/specs/binding-http-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/http/kafka/streams/HttpIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class HttpIT { diff --git a/specs/binding-http-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/http/kafka/streams/KafkaIT.java b/specs/binding-http-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/http/kafka/streams/KafkaIT.java index be2cfb4e94..16b9cc07b2 100644 --- a/specs/binding-http-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/http/kafka/streams/KafkaIT.java +++ b/specs/binding-http-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/http/kafka/streams/KafkaIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class KafkaIT { diff --git a/specs/binding-http.spec/pom.xml b/specs/binding-http.spec/pom.xml index 492554c5cf..338e8ed3f2 100644 --- a/specs/binding-http.spec/pom.xml +++ b/specs/binding-http.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 0.99 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -110,7 +108,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-http.spec/src/main/java/io/aklivity/zilla/specs/binding/http/internal/HttpFunctions.java b/specs/binding-http.spec/src/main/java/io/aklivity/zilla/specs/binding/http/internal/HttpFunctions.java index 62a13d5f3f..78699e194a 100644 --- a/specs/binding-http.spec/src/main/java/io/aklivity/zilla/specs/binding/http/internal/HttpFunctions.java +++ b/specs/binding-http.spec/src/main/java/io/aklivity/zilla/specs/binding/http/internal/HttpFunctions.java @@ -32,10 +32,10 @@ import org.agrona.MutableDirectBuffer; import org.agrona.collections.MutableBoolean; import org.agrona.concurrent.UnsafeBuffer; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.specs.binding.http.internal.types.stream.HttpBeginExFW; import io.aklivity.zilla.specs.binding.http.internal.types.stream.HttpChallengeExFW; import io.aklivity.zilla.specs.binding.http.internal.types.stream.HttpEndExFW; diff --git a/specs/binding-http.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/binding-http.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/binding-http.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/binding-http.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml index 8411e8348e..acaf62c8d7 100644 --- a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml +++ b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.http.request.accepted - message: REQUEST_ACCEPTED - http GET localhost:8080 / + name: BINDING_HTTP_REQUEST_ACCEPTED + message: "- GET http://localhost:8080/" bindings: net0: type: http diff --git a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml index 0a1cebed55..78534a2dc1 100644 --- a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml +++ b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.http.request.accepted - message: REQUEST_ACCEPTED - http GET localhost:8080 / + name: BINDING_HTTP_REQUEST_ACCEPTED + message: "- GET http://localhost:8080/" bindings: net0: type: http diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/internal/HttpFunctionsTest.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/internal/HttpFunctionsTest.java index b5513e3721..7fd0510115 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/internal/HttpFunctionsTest.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/internal/HttpFunctionsTest.java @@ -45,9 +45,9 @@ import org.agrona.DirectBuffer; import org.agrona.concurrent.UnsafeBuffer; import org.junit.Test; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.internal.el.ExpressionContext; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.internal.el.ExpressionContext; import io.aklivity.zilla.specs.binding.http.internal.types.stream.HttpBeginExFW; import io.aklivity.zilla.specs.binding.http.internal.types.stream.HttpChallengeExFW; import io.aklivity.zilla.specs.binding.http.internal.types.stream.HttpEndExFW; diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/AccessControlIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/AccessControlIT.java index dc3a616dc2..89256d4e48 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/AccessControlIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/AccessControlIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AccessControlIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/AdvisoryIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/AdvisoryIT.java index a20744ed28..252d04afdd 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/AdvisoryIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/AdvisoryIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AdvisoryIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/ArchitectureIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/ArchitectureIT.java index 51dbb9653e..a46d58acb8 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/ArchitectureIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/ArchitectureIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ArchitectureIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/AuthorizationIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/AuthorizationIT.java index fe828b7cb4..8fc11c014f 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/AuthorizationIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/AuthorizationIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AuthorizationIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/ConnectionManagementIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/ConnectionManagementIT.java index 9b007c530f..719b1c6abc 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/ConnectionManagementIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/ConnectionManagementIT.java @@ -24,8 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ConnectionManagementIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/FlowControlIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/FlowControlIT.java index 9c2029d1d8..2c1a76c3e9 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/FlowControlIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/FlowControlIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class FlowControlIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/MessageFormatIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/MessageFormatIT.java index 820e81d011..352a105f63 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/MessageFormatIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/MessageFormatIT.java @@ -24,8 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class MessageFormatIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/TransferCodingsIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/TransferCodingsIT.java index 9fbc7fbf57..ac02988be5 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/TransferCodingsIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/TransferCodingsIT.java @@ -24,8 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class TransferCodingsIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/ValidationIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/ValidationIT.java index 67697b9a53..75fffc2ab2 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/ValidationIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7230/ValidationIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ValidationIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/AbortIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/AbortIT.java index 7090ab6351..1f5dbc134b 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/AbortIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/AbortIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AbortIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/AccessControlIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/AccessControlIT.java index 19b285dfda..56baed0595 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/AccessControlIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/AccessControlIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AccessControlIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/AuthorizationIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/AuthorizationIT.java index 5b813df8a3..b67b4dc1ad 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/AuthorizationIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/AuthorizationIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AuthorizationIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/ConfigIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/ConfigIT.java index f4fc4ce78e..2e9235d91f 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/ConfigIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/ConfigIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ConfigIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/ConnectionManagementIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/ConnectionManagementIT.java index ecb7a30788..cdf576e48a 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/ConnectionManagementIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/ConnectionManagementIT.java @@ -24,9 +24,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ConnectionManagementIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/FlowControlIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/FlowControlIT.java index c8f6299760..9ca0ef4617 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/FlowControlIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/FlowControlIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class FlowControlIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/MessageFormatIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/MessageFormatIT.java index b587a13b8b..c023771dd2 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/MessageFormatIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/MessageFormatIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class MessageFormatIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/SettingsIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/SettingsIT.java index 0641e43c08..770618bcb6 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/SettingsIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/SettingsIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class SettingsIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/StartingIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/StartingIT.java index 2e00f1e105..59d17f71c1 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/StartingIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/StartingIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class StartingIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/ValidationIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/ValidationIT.java index 9df3169f66..4575136425 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/ValidationIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/ValidationIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ValidationIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/AccessControlIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/AccessControlIT.java index 1838c697a9..525e5ff723 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/AccessControlIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/AccessControlIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AccessControlIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/AdvisoryIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/AdvisoryIT.java index a3cf6ff056..eb0b9de83b 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/AdvisoryIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/AdvisoryIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AdvisoryIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/ArchitectureIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/ArchitectureIT.java index 97aacc26cb..1933c8ac58 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/ArchitectureIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/ArchitectureIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ArchitectureIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/AuthorizationIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/AuthorizationIT.java index df253206f4..48033c71b1 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/AuthorizationIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/AuthorizationIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AuthorizationIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/ConnectionManagementIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/ConnectionManagementIT.java index 916cf3d170..b6ddc185b6 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/ConnectionManagementIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/ConnectionManagementIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ConnectionManagementIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/FlowControlIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/FlowControlIT.java index 9926ab8106..887f35704e 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/FlowControlIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/FlowControlIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class FlowControlIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/MessageFormatIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/MessageFormatIT.java index 7d638c2b0a..f279c61fb1 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/MessageFormatIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/MessageFormatIT.java @@ -24,8 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class MessageFormatIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/TransferCodingsIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/TransferCodingsIT.java index 46ad47c691..51d4a53bc2 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/TransferCodingsIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/TransferCodingsIT.java @@ -24,8 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class TransferCodingsIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/ValidationIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/ValidationIT.java index be27a81ae6..44458ee057 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/ValidationIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7230/ValidationIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ValidationIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/AbortIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/AbortIT.java index 8d4eac9bf7..6196c614cb 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/AbortIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/AbortIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AbortIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/AccessControlIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/AccessControlIT.java index c423a35a5e..c05753c544 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/AccessControlIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/AccessControlIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AccessControlIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/AuthorizationIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/AuthorizationIT.java index 2fd2689cf6..787c1cd09d 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/AuthorizationIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/AuthorizationIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AuthorizationIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/ConfigIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/ConfigIT.java index dc604d9171..6ea4f9b091 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/ConfigIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/ConfigIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ConfigIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/ConnectionManagementIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/ConnectionManagementIT.java index 50a9c95824..0e644a842a 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/ConnectionManagementIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/ConnectionManagementIT.java @@ -24,8 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ConnectionManagementIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/FlowControlIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/FlowControlIT.java index cdb0b0bcbe..65617bc712 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/FlowControlIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/FlowControlIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class FlowControlIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/MessageFormatIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/MessageFormatIT.java index ab2c23a4af..b4daa7d58f 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/MessageFormatIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/MessageFormatIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class MessageFormatIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/SettingsIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/SettingsIT.java index e23a0f3b96..1b505c42b4 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/SettingsIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/SettingsIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class SettingsIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/StartingIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/StartingIT.java index 6ee987d153..853e563d3b 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/StartingIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/StartingIT.java @@ -24,8 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class StartingIT { diff --git a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/ValidationIT.java b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/ValidationIT.java index e4156fa065..9aaedb94ea 100644 --- a/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/ValidationIT.java +++ b/specs/binding-http.spec/src/test/java/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/ValidationIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ValidationIT { diff --git a/specs/binding-kafka-grpc.spec/pom.xml b/specs/binding-kafka-grpc.spec/pom.xml index 9a96c623a5..483d82f4d3 100644 --- a/specs/binding-kafka-grpc.spec/pom.xml +++ b/specs/binding-kafka-grpc.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -52,8 +50,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -115,7 +113,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-kafka-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/grpc/internal/streams/GrpcIT.java b/specs/binding-kafka-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/grpc/internal/streams/GrpcIT.java index 57cbab7e06..639def8fa1 100644 --- a/specs/binding-kafka-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/grpc/internal/streams/GrpcIT.java +++ b/specs/binding-kafka-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/grpc/internal/streams/GrpcIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class GrpcIT { diff --git a/specs/binding-kafka-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/grpc/internal/streams/KafkaIT.java b/specs/binding-kafka-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/grpc/internal/streams/KafkaIT.java index ca46d94c61..163ba7c318 100644 --- a/specs/binding-kafka-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/grpc/internal/streams/KafkaIT.java +++ b/specs/binding-kafka-grpc.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/grpc/internal/streams/KafkaIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class KafkaIT diff --git a/specs/binding-kafka.spec/pom.xml b/specs/binding-kafka.spec/pom.xml index 33c0ffcf47..0a674667cb 100644 --- a/specs/binding-kafka.spec/pom.xml +++ b/specs/binding-kafka.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 0.90 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -110,7 +108,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-kafka.spec/src/main/java/io/aklivity/zilla/specs/binding/kafka/internal/KafkaFunctions.java b/specs/binding-kafka.spec/src/main/java/io/aklivity/zilla/specs/binding/kafka/internal/KafkaFunctions.java index 692cc2c6fd..1a1225b9aa 100644 --- a/specs/binding-kafka.spec/src/main/java/io/aklivity/zilla/specs/binding/kafka/internal/KafkaFunctions.java +++ b/specs/binding-kafka.spec/src/main/java/io/aklivity/zilla/specs/binding/kafka/internal/KafkaFunctions.java @@ -28,10 +28,10 @@ import org.agrona.DirectBuffer; import org.agrona.MutableDirectBuffer; import org.agrona.concurrent.UnsafeBuffer; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.specs.binding.kafka.internal.types.Array32FW; import io.aklivity.zilla.specs.binding.kafka.internal.types.KafkaAckMode; import io.aklivity.zilla.specs.binding.kafka.internal.types.KafkaCapabilities; diff --git a/specs/binding-kafka.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/binding-kafka.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/binding-kafka.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/binding-kafka.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/cache.options.extract.headers.yaml b/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/cache.options.extract.headers.yaml new file mode 100644 index 0000000000..e1a2b64e09 --- /dev/null +++ b/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/cache.options.extract.headers.yaml @@ -0,0 +1,67 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +--- +name: test +catalogs: + test0: + type: test + options: + id: 1 + schema: | + { + "type": "object", + "properties": { + "correlationId": { + "type": "integer" + }, + "status": { + "type": "string" + } + }, + "required": [ + "correlationId", + "status" + ] + } +bindings: + app0: + type: kafka + kind: cache_client + routes: + - exit: cache0 + when: + - topic: test + cache0: + type: kafka + kind: cache_server + options: + topics: + - name: test + headers: + correlation-id: ${message.value.correlationId} + value: + model: test + capability: read + length: 12 + catalog: + test0: + - id: 1 + routes: + - exit: app1 + when: + - topic: test + diff --git a/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/client.event.yaml b/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/client.event.yaml index 1fde456a84..3610b32b36 100644 --- a/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/client.event.yaml +++ b/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/client.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.app0 id: binding.kafka.api.version.rejected - message: API_VERSION_REJECTED 32 0 + name: BINDING_KAFKA_API_VERSION_REJECTED + message: 32 0 bindings: app0: type: kafka diff --git a/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/schema/kafka.schema.patch.json b/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/schema/kafka.schema.patch.json index 15b1c2fe79..ca060534cd 100644 --- a/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/schema/kafka.schema.patch.json +++ b/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/schema/kafka.schema.patch.json @@ -167,6 +167,19 @@ "enum": [ "none", "json_patch" ], "deprecated": true }, + "headers": + { + "type": "object", + "patternProperties": + { + "^[a-zA-Z]+[a-zA-Z0-9\\._\\-]*$": + { + "type": "string", + "pattern": "^\\$\\{message\\.value\\.([A-Za-z_][A-Za-z0-9_]*)\\}$" + } + }, + "additionalProperties": false + }, "key": { "$ref": "#/$defs/converter" diff --git a/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/streams/application/fetch/filter.extracted.header/client.rpt b/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/streams/application/fetch/filter.extracted.header/client.rpt new file mode 100644 index 0000000000..3b4c05c091 --- /dev/null +++ b/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/streams/application/fetch/filter.extracted.header/client.rpt @@ -0,0 +1,93 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +connect "zilla://streams/app0" + option zilla:window 8192 + option zilla:transmission "half-duplex" + +write zilla:begin.ext ${kafka:beginEx() + .typeId(zilla:id("kafka")) + .meta() + .topic("test") + .build() + .build()} + +connected + +read zilla:begin.ext ${kafka:beginEx() + .typeId(zilla:id("kafka")) + .meta() + .topic("test") + .build() + .build()} + +read zilla:data.ext ${kafka:dataEx() + .typeId(zilla:id("kafka")) + .meta() + .partition(0, 177) + .build() + .build()} + +read notify ROUTED_BROKER_CLIENT + +connect await ROUTED_BROKER_CLIENT + "zilla://streams/app0" + option zilla:window 8192 + option zilla:transmission "half-duplex" + option zilla:affinity 0xb1 + +write zilla:begin.ext ${kafka:beginEx() + .typeId(zilla:id("kafka")) + .fetch() + .topic("test") + .partition(0, 1) + .filter() + .header("header1", "value1") + .build() + .build() + .build()} + +connected + +read zilla:begin.ext ${kafka:beginEx() + .typeId(zilla:id("kafka")) + .fetch() + .topic("test") + .partition(0, 1, 8) + .build() + .build()} + +read zilla:data.ext ${kafka:matchDataEx() + .typeId(zilla:id("kafka")) + .fetch() + .partition(0, 2, 8) + .header("header1", "value1") + .header("correlation-id", "12345") + .build() + .build()} +read "Hello, world" + +read notify RECEIVED_MESSAGE_2 + +read zilla:data.ext ${kafka:matchDataEx() + .typeId(zilla:id("kafka")) + .fetch() + .partition(0, 3, 8) + .header("header1", "value1") + .header("correlation-id", "12345") + .build() + .build()} +read "Hello, world" diff --git a/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/streams/application/fetch/filter.extracted.header/server.rpt b/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/streams/application/fetch/filter.extracted.header/server.rpt new file mode 100644 index 0000000000..2631f0d174 --- /dev/null +++ b/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/streams/application/fetch/filter.extracted.header/server.rpt @@ -0,0 +1,99 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +property deltaMillis 0L +property newTimestamp ${kafka:timestamp() + deltaMillis} + +property serverAddress "zilla://streams/app0" + +accept ${serverAddress} + option zilla:window 8192 + option zilla:transmission "half-duplex" + +accepted + +read zilla:begin.ext ${kafka:beginEx() + .typeId(zilla:id("kafka")) + .meta() + .topic("test") + .build() + .build()} + +connected + +write zilla:begin.ext ${kafka:beginEx() + .typeId(zilla:id("kafka")) + .meta() + .topic("test") + .build() + .build()} +write flush + +write zilla:data.ext ${kafka:dataEx() + .typeId(zilla:id("kafka")) + .meta() + .partition(0, 177) + .build() + .build()} +write flush + +accepted + +read zilla:begin.ext ${kafka:beginEx() + .typeId(zilla:id("kafka")) + .fetch() + .topic("test") + .partition(0, 1) + .filter() + .header("header1", "value1") + .build() + .build() + .build()} + +connected + +write zilla:begin.ext ${kafka:beginEx() + .typeId(zilla:id("kafka")) + .fetch() + .topic("test") + .partition(0, 1, 8) + .build() + .build()} +write flush + +write zilla:data.ext ${kafka:dataEx() + .typeId(zilla:id("kafka")) + .fetch() + .timestamp(newTimestamp) + .partition(0, 2, 8) + .header("header1", "value1") + .header("correlation-id", "12345") + .build() + .build()} +write "Hello, world" +write flush + +write zilla:data.ext ${kafka:dataEx() + .typeId(zilla:id("kafka")) + .fetch() + .timestamp(newTimestamp) + .partition(0, 3, 8) + .header("header1", "value1") + .header("correlation-id", "12345") + .build() + .build()} +write "Hello, world" +write flush diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/config/SchemaTest.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/config/SchemaTest.java index d4fc6ca88e..12e2f05cb3 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/config/SchemaTest.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/config/SchemaTest.java @@ -130,4 +130,12 @@ public void shouldValidateCacheOptionsValidate() assertThat(config, not(nullValue())); } + + @Test + public void shouldValidateCacheOptionsExtractHeaders() + { + JsonObject config = schema.validate("cache.options.extract.headers.yaml"); + + assertThat(config, not(nullValue())); + } } diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/internal/KafkaFunctionsTest.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/internal/KafkaFunctionsTest.java index aa6e3dbcdd..90b6675b93 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/internal/KafkaFunctionsTest.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/internal/KafkaFunctionsTest.java @@ -15,6 +15,7 @@ */ package io.aklivity.zilla.specs.binding.kafka.internal; +import static io.aklivity.k3po.runtime.lang.internal.el.ExpressionFactoryUtils.newExpressionFactory; import static io.aklivity.zilla.specs.binding.kafka.internal.types.KafkaConditionType.HEADER; import static io.aklivity.zilla.specs.binding.kafka.internal.types.KafkaConditionType.HEADERS; import static io.aklivity.zilla.specs.binding.kafka.internal.types.KafkaConditionType.KEY; @@ -26,7 +27,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import static org.kaazing.k3po.lang.internal.el.ExpressionFactoryUtils.newExpressionFactory; import java.nio.ByteBuffer; import java.nio.ByteOrder; @@ -41,9 +41,9 @@ import org.agrona.concurrent.UnsafeBuffer; import org.junit.Before; import org.junit.Test; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.internal.el.ExpressionContext; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.internal.el.ExpressionContext; import io.aklivity.zilla.specs.binding.kafka.internal.types.Array32FW; import io.aklivity.zilla.specs.binding.kafka.internal.types.KafkaAckMode; import io.aklivity.zilla.specs.binding.kafka.internal.types.KafkaCapabilities; diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/BootstrapIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/BootstrapIT.java index 0a1ca5b38d..cf68f4b9b6 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/BootstrapIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/BootstrapIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class BootstrapIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/ConsumerIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/ConsumerIT.java index e2ac297918..96570ea241 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/ConsumerIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/ConsumerIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ConsumerIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/DescribeIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/DescribeIT.java index 7676269e8d..ec3c0b2761 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/DescribeIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/DescribeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class DescribeIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/FetchIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/FetchIT.java index d234d7b1b6..d774af051a 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/FetchIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/FetchIT.java @@ -24,8 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class FetchIT { @@ -349,6 +350,15 @@ public void shouldReceiveMessagesWithHeaderFilter() throws Exception k3po.finish(); } + @Test + @Specification({ + "${app}/filter.extracted.header/client", + "${app}/filter.extracted.header/server"}) + public void shouldReceiveMessagesWithExtractedHeaderFilter() throws Exception + { + k3po.finish(); + } + @Test @Specification({ "${app}/filter.header.and.header/client", diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/GroupIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/GroupIT.java index 32a6186e4a..fba8aeefe8 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/GroupIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/GroupIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class GroupIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/InitProducerIdIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/InitProducerIdIT.java index 794acf430c..3da9283d49 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/InitProducerIdIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/InitProducerIdIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class InitProducerIdIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/MergedIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/MergedIT.java index 6aa5454608..8afbd4bbad 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/MergedIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/MergedIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class MergedIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/MetaIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/MetaIT.java index ec008694d1..b956283a27 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/MetaIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/MetaIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class MetaIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/OffsetCommitIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/OffsetCommitIT.java index 01b17bb654..2cdced4b81 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/OffsetCommitIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/OffsetCommitIT.java @@ -18,14 +18,14 @@ import static java.util.concurrent.TimeUnit.SECONDS; import static org.junit.rules.RuleChain.outerRule; - import org.junit.Rule; import org.junit.Test; import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class OffsetCommitIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/OffsetFetchIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/OffsetFetchIT.java index 0251c5b2bb..6adc35edb4 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/OffsetFetchIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/OffsetFetchIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class OffsetFetchIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/ProduceIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/ProduceIT.java index 68c95e2df5..7a29a25aa0 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/ProduceIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/application/ProduceIT.java @@ -24,8 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ProduceIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/DescribeConfigsIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/DescribeConfigsIT.java index 4046bd09b7..5a7af9aad7 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/DescribeConfigsIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/DescribeConfigsIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class DescribeConfigsIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/DescribeConfigsSaslIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/DescribeConfigsSaslIT.java index 1435355353..ca0d6eae3e 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/DescribeConfigsSaslIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/DescribeConfigsSaslIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class DescribeConfigsSaslIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/FetchIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/FetchIT.java index 959e14b383..e7d5e7bbe4 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/FetchIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/FetchIT.java @@ -24,8 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class FetchIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/FetchSaslIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/FetchSaslIT.java index 05a90db4ae..a6920a6a43 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/FetchSaslIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/FetchSaslIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class FetchSaslIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/GroupIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/GroupIT.java index 30e9e2f58e..f9508d3006 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/GroupIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/GroupIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class GroupIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/GroupSaslIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/GroupSaslIT.java index c6f36073ab..b7dedc5d04 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/GroupSaslIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/GroupSaslIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class GroupSaslIT diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/InitProducerIdIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/InitProducerIdIT.java index db9e626f68..307d9d68c9 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/InitProducerIdIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/InitProducerIdIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class InitProducerIdIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/InitProducerIdSaslIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/InitProducerIdSaslIT.java index a3c795dfd5..8b89dd5041 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/InitProducerIdSaslIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/InitProducerIdSaslIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class InitProducerIdSaslIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/MetadataIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/MetadataIT.java index 3b2675ae53..62314f6844 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/MetadataIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/MetadataIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class MetadataIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/MetadataSaslIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/MetadataSaslIT.java index adba21be89..ba3d64a81f 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/MetadataSaslIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/MetadataSaslIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class MetadataSaslIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetCommitIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetCommitIT.java index 2506870690..41f86ea80c 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetCommitIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetCommitIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class OffsetCommitIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetCommitSaslIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetCommitSaslIT.java index b6b5313d61..64b225544d 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetCommitSaslIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetCommitSaslIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class OffsetCommitSaslIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetFetchIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetFetchIT.java index a6ca0c090b..62003f75f5 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetFetchIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetFetchIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class OffsetFetchIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetFetchSaslIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetFetchSaslIT.java index 1b4a26c0bb..bcb4efc8a0 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetFetchSaslIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/OffsetFetchSaslIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class OffsetFetchSaslIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/ProduceIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/ProduceIT.java index f62ffb3baf..112cdd4a07 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/ProduceIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/ProduceIT.java @@ -24,8 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ProduceIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/ProduceSaslIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/ProduceSaslIT.java index 9d34c702c0..3b58224693 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/ProduceSaslIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/ProduceSaslIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ProduceSaslIT { diff --git a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/UnmergedIT.java b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/UnmergedIT.java index 3d8a68eea7..ee2ca47569 100644 --- a/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/UnmergedIT.java +++ b/specs/binding-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/kafka/streams/network/UnmergedIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class UnmergedIT { diff --git a/specs/binding-mqtt-kafka.spec/pom.xml b/specs/binding-mqtt-kafka.spec/pom.xml index cce6120ee3..e73f389a10 100644 --- a/specs/binding-mqtt-kafka.spec/pom.xml +++ b/specs/binding-mqtt-kafka.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -57,8 +55,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -120,7 +118,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-mqtt-kafka.spec/src/main/java/io/aklivity/zilla/specs/binding/mqtt/kafka/internal/MqttKafkaFunctions.java b/specs/binding-mqtt-kafka.spec/src/main/java/io/aklivity/zilla/specs/binding/mqtt/kafka/internal/MqttKafkaFunctions.java index 4d6b9f34c0..e9df4a5040 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/java/io/aklivity/zilla/specs/binding/mqtt/kafka/internal/MqttKafkaFunctions.java +++ b/specs/binding-mqtt-kafka.spec/src/main/java/io/aklivity/zilla/specs/binding/mqtt/kafka/internal/MqttKafkaFunctions.java @@ -18,11 +18,14 @@ import org.agrona.BitUtil; import org.agrona.MutableDirectBuffer; import org.agrona.concurrent.UnsafeBuffer; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.specs.binding.mqtt.kafka.internal.types.MqttPublishOffsetMetadataFW; import io.aklivity.zilla.specs.binding.mqtt.kafka.internal.types.MqttSubscribeOffsetMetadataFW; +import io.aklivity.zilla.specs.binding.mqtt.kafka.internal.types.MqttSubscribeOffsetMetadataV1FW; +import io.aklivity.zilla.specs.binding.mqtt.kafka.internal.types.MqttSubscribeOffsetMetadataV2FW; +import io.aklivity.zilla.specs.binding.mqtt.kafka.internal.types.MqttSubscribeOffsetMetadataVersion; public final class MqttKafkaFunctions { @@ -40,30 +43,84 @@ public static MqttPublishOffsetMetadataBuilder publishMetadata() public static final class MqttSubscribeOffsetMetadataBuilder { - private final MqttSubscribeOffsetMetadataFW.Builder offsetMetadataRW = new MqttSubscribeOffsetMetadataFW.Builder(); - - byte version = 1; + private final MqttSubscribeOffsetMetadataFW.Builder offsetMetadataRW = + new MqttSubscribeOffsetMetadataFW.Builder(); + private final MqttSubscribeOffsetMetadataFW offsetMetadataRO = new MqttSubscribeOffsetMetadataFW(); + private final MutableDirectBuffer writeBuffer = new UnsafeBuffer(new byte[1024 * 8]); private MqttSubscribeOffsetMetadataBuilder() { - MutableDirectBuffer writeBuffer = new UnsafeBuffer(new byte[1024 * 8]); offsetMetadataRW.wrap(writeBuffer, 0, writeBuffer.capacity()); - offsetMetadataRW.version(version); } - public MqttSubscribeOffsetMetadataBuilder metadata( - int packetId) + public MqttSubscribeOffsetMetadataV1Builder v1() { - offsetMetadataRW.appendPacketIds((short) packetId); - return this; + offsetMetadataRW.kind(MqttSubscribeOffsetMetadataVersion.V1); + return new MqttSubscribeOffsetMetadataV1Builder(); + } + + public MqttSubscribeOffsetMetadataV2Builder v2() + { + offsetMetadataRW.kind(MqttSubscribeOffsetMetadataVersion.V2); + return new MqttSubscribeOffsetMetadataV2Builder(); } public String build() { - final MqttSubscribeOffsetMetadataFW offsetMetadata = offsetMetadataRW.build(); + final MqttSubscribeOffsetMetadataFW offsetMetadata = offsetMetadataRO; return BitUtil.toHex(offsetMetadata.buffer().byteArray(), offsetMetadata.offset(), offsetMetadata.limit()); } + + public final class MqttSubscribeOffsetMetadataV1Builder + { + private final MqttSubscribeOffsetMetadataV1FW.Builder offsetMetadataV1RW = + new MqttSubscribeOffsetMetadataV1FW.Builder(); + + private MqttSubscribeOffsetMetadataV1Builder() + { + offsetMetadataV1RW.wrap(writeBuffer, 1, writeBuffer.capacity()); + } + + public MqttSubscribeOffsetMetadataV1Builder metadata( + int packetId) + { + offsetMetadataV1RW.appendPacketIds((short) packetId); + return this; + } + + public MqttSubscribeOffsetMetadataBuilder build() + { + final MqttSubscribeOffsetMetadataV1FW offsetMetadataV1 = offsetMetadataV1RW.build(); + offsetMetadataRO.wrap(writeBuffer, 0, offsetMetadataV1.limit()); + return MqttSubscribeOffsetMetadataBuilder.this; + } + } + + public final class MqttSubscribeOffsetMetadataV2Builder + { + private final MqttSubscribeOffsetMetadataV2FW.Builder offsetMetadataV2RW = + new MqttSubscribeOffsetMetadataV2FW.Builder(); + + private MqttSubscribeOffsetMetadataV2Builder() + { + offsetMetadataV2RW.wrap(writeBuffer, 1, writeBuffer.capacity()); + } + + public MqttSubscribeOffsetMetadataV2Builder metadata( + int packetId) + { + offsetMetadataV2RW.appendPacketIds((short) packetId); + return this; + } + + public MqttSubscribeOffsetMetadataBuilder build() + { + final MqttSubscribeOffsetMetadataV2FW offsetMetadataV2 = offsetMetadataV2RW.build(); + offsetMetadataRO.wrap(writeBuffer, 0, offsetMetadataV2.limit()); + return MqttSubscribeOffsetMetadataBuilder.this; + } + } } public static final class MqttPublishOffsetMetadataBuilder diff --git a/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl b/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl index 5b5cd547f2..a81acbcb3c 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl +++ b/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl @@ -15,13 +15,30 @@ scope mqtt_kafka { - struct MqttSubscribeOffsetMetadata + enum MqttSubscribeOffsetMetadataVersion (uint8) + { + V1 (1), + V2 (2) + } + + struct MqttSubscribeOffsetMetadataV1 { - uint8 version = 1; int8 length; int16[length] packetIds = null; } + struct MqttSubscribeOffsetMetadataV2 + { + int16 length; + int16[length] packetIds = null; + } + + union MqttSubscribeOffsetMetadata switch (MqttSubscribeOffsetMetadataVersion) + { + case V1: MqttSubscribeOffsetMetadataV1 subscribeMetadataV1; + case V2: MqttSubscribeOffsetMetadataV2 subscribeMetadataV2; + } + struct MqttPublishOffsetMetadata { uint8 version = 1; @@ -38,14 +55,14 @@ scope mqtt_kafka NON_COMPACT_SESSIONS_TOPIC (1) } - struct MqttKafkaResetMqttConnectionEx extends core::stream::Extension + struct MqttKafkaNonCompactSessionsTopicEx extends core::stream::Extension { - string16 reason; + string16 topic; } union MqttKafkaEventEx switch (MqttKafkaEventType) { - case NON_COMPACT_SESSIONS_TOPIC: MqttKafkaResetMqttConnectionEx nonCompactSessionsTopic; + case NON_COMPACT_SESSIONS_TOPIC: MqttKafkaNonCompactSessionsTopicEx nonCompactSessionsTopic; } } } \ No newline at end of file diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml index f6c94af5cc..a7c0e1a685 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.kafka0 id: binding.mqtt.kafka.non.compact.sessions.topic - message: NON COMPACT SESSIONS TOPIC - Sessions Kafka topic in non-compacted + name: BINDING_MQTT_KAFKA_NON_COMPACT_SESSIONS_TOPIC + message: The sessions topic (mqtt-sessions) is not log compacted. Update the cleanup policy to enable log compaction. bindings: mqtt0: type: mqtt-kafka diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.publish.qos.max.yaml b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.publish.qos.max.yaml new file mode 100644 index 0000000000..f28f9e34aa --- /dev/null +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.publish.qos.max.yaml @@ -0,0 +1,29 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +--- +name: test +bindings: + mqtt0: + type: mqtt-kafka + kind: proxy + options: + topics: + sessions: mqtt-sessions + messages: mqtt-messages + retained: mqtt-retained + publish: + qosMax: at_least_once + exit: kafka0 diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/schema/mqtt.kafka.schema.patch.json b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/schema/mqtt.kafka.schema.patch.json index 0ffc1a8a79..8e432698e3 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/schema/mqtt.kafka.schema.patch.json +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/schema/mqtt.kafka.schema.patch.json @@ -80,6 +80,27 @@ { "type": "string" } + }, + "publish": + { + "title": "Publish", + "type": "object", + "properties": + { + "qosMax": + { + "title": "Maximum QoS", + "type": "string", + "enum": [ "at_most_once", "at_least_once", "exactly_once" ], + "default": "exactly_once" + }, + "additionalProperties": false + }, + "required": + [ + "qosMax" + ], + "additionalProperties": false } }, "required": diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/session.reject.non.compacted.sessions.topic/client.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/session.reject.non.compacted.sessions.topic/client.rpt index a8498c5c61..0a25a46830 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/session.reject.non.compacted.sessions.topic/client.rpt +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/session.reject.non.compacted.sessions.topic/client.rpt @@ -110,4 +110,7 @@ read zilla:begin.ext ${kafka:beginEx() .build() .build()} -connected \ No newline at end of file +connected + +write abort +read aborted diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/session.reject.non.compacted.sessions.topic/server.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/session.reject.non.compacted.sessions.topic/server.rpt index f84db986bc..91a9e09489 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/session.reject.non.compacted.sessions.topic/server.rpt +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/session.reject.non.compacted.sessions.topic/server.rpt @@ -105,4 +105,7 @@ write zilla:begin.ext ${kafka:beginEx() .build() .build()} -connect abort +connected + +read aborted +write abort diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.qos2.version1.offset.metadata/client.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.qos2.version1.offset.metadata/client.rpt new file mode 100644 index 0000000000..f78727ec19 --- /dev/null +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.qos2.version1.offset.metadata/client.rpt @@ -0,0 +1,116 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "zilla://streams/kafka0" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${kafka:beginEx() + .typeId(zilla:id("kafka")) + .merged() + .capabilities("FETCH_ONLY") + .topic("mqtt-messages") + .groupId("zilla:test-mqtt0-client") + .filter() + .headers("zilla:filter") + .sequence("sensor") + .sequence("one") + .build() + .headerNot("zilla:qos", "0") + .headerNot("zilla:qos", "1") + .build() + .evaluation("EAGER") + .build() + .build()} + +read zilla:begin.ext ${kafka:matchBeginEx() + .typeId(zilla:id("kafka")) + .merged() + .capabilities("FETCH_ONLY") + .topic("mqtt-messages") + .partition(0, 0, 1, 1, mqtt_kafka:subscribeMetadata() + .v1() + .metadata(10) + .metadata(20) + .build() + .build()) + .build() + .build()} + +connected + + +read zilla:data.ext ${kafka:matchDataEx() + .typeId(zilla:id("kafka")) + .merged() + .fetch() + .filters(1) + .partition(0, 2, 2) + .progress(0, 3) + .progress(1, 1) + .key("sensor/one") + .header("zilla:filter", "sensor") + .header("zilla:filter", "one") + .header("zilla:local", "client") + .header("zilla:format", "TEXT") + .header("zilla:qos", "2") + .build() + .build()} +read "message" + +write advise zilla:flush ${kafka:flushEx() + .typeId(zilla:id("kafka")) + .merged() + .consumer() + .progress(0, 3, mqtt_kafka:subscribeMetadata() + .v2() + .metadata(10) + .metadata(20) + .metadata(1) + .build() + .build()) + .correlationId(1) + .build() + .build()} + +read advised zilla:flush ${kafka:matchFlushEx() + .typeId(zilla:id("kafka")) + .merged() + .consumer() + .progress(0, 3) + .correlationId(1) + .build() + .build()} + +write advise zilla:flush ${kafka:flushEx() + .typeId(zilla:id("kafka")) + .merged() + .consumer() + .progress(0, 3, mqtt_kafka:subscribeMetadata() + .v2() + .metadata(10) + .metadata(20) + .build() + .build()) + .build() + .build()} + +read advised zilla:flush ${kafka:matchFlushEx() + .typeId(zilla:id("kafka")) + .merged() + .consumer() + .progress(0, 3) + .build() + .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.qos2.version1.offset.metadata/server.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.qos2.version1.offset.metadata/server.rpt new file mode 100644 index 0000000000..901b145ea7 --- /dev/null +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.qos2.version1.offset.metadata/server.rpt @@ -0,0 +1,120 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "zilla://streams/kafka0" + option zilla:window 8192 + option zilla:transmission "duplex" + +accepted + +read zilla:begin.ext ${kafka:matchBeginEx() + .typeId(zilla:id("kafka")) + .merged() + .capabilities("FETCH_ONLY") + .topic("mqtt-messages") + .groupId("zilla:test-mqtt0-client") + .filter() + .headers("zilla:filter") + .sequence("sensor") + .sequence("one") + .build() + .headerNot("zilla:qos", "0") + .headerNot("zilla:qos", "1") + .build() + .evaluation("EAGER") + .build() + .build()} + +write zilla:begin.ext ${kafka:beginEx() + .typeId(zilla:id("kafka")) + .merged() + .capabilities("FETCH_ONLY") + .topic("mqtt-messages") + .partition(0, 0, 1, 1,mqtt_kafka:subscribeMetadata() + .v1() + .metadata(10) + .metadata(20) + .build() + .build()) + .build() + .build()} + +connected + + +write zilla:data.ext ${kafka:dataEx() + .typeId(zilla:id("kafka")) + .merged() + .fetch() + .timestamp(kafka:timestamp()) + .filters(1) + .partition(0, 2, 2) + .progress(0, 3) + .progress(1, 1) + .key("sensor/one") + .header("zilla:filter", "sensor") + .header("zilla:filter", "one") + .header("zilla:local", "client") + .header("zilla:format", "TEXT") + .header("zilla:qos", "2") + .build() + .build()} +write "message" +write flush + +read advised zilla:flush ${kafka:matchFlushEx() + .typeId(zilla:id("kafka")) + .merged() + .consumer() + .progress(0, 3,mqtt_kafka:subscribeMetadata() + .v2() + .metadata(10) + .metadata(20) + .metadata(1) + .build() + .build()) + .correlationId(1) + .build() + .build()} + +write advise zilla:flush ${kafka:flushEx() + .typeId(zilla:id("kafka")) + .merged() + .consumer() + .progress(0, 3) + .correlationId(1) + .build() + .build()} + +read advised zilla:flush ${kafka:matchFlushEx() + .typeId(zilla:id("kafka")) + .merged() + .consumer() + .progress(0, 3, mqtt_kafka:subscribeMetadata() + .v2() + .metadata(10) + .metadata(20) + .build() + .build()) + .build() + .build()} + +write advise zilla:flush ${kafka:flushEx() + .typeId(zilla:id("kafka")) + .merged() + .consumer() + .progress(0, 3) + .build() + .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.overlapping.wildcard.mixed.qos/client.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.overlapping.wildcard.mixed.qos/client.rpt index de153e4569..0b108b3488 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.overlapping.wildcard.mixed.qos/client.rpt +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.overlapping.wildcard.mixed.qos/client.rpt @@ -226,8 +226,10 @@ write advise zilla:flush ${kafka:flushEx() .consumer() .progress(0, 3, mqtt_kafka:subscribeMetadata() - .metadata(2) - .build()) + .v2() + .metadata(2) + .build() + .build()) .correlationId(2) .build() .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.overlapping.wildcard.mixed.qos/server.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.overlapping.wildcard.mixed.qos/server.rpt index bcbc9570bd..d03a367483 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.overlapping.wildcard.mixed.qos/server.rpt +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.overlapping.wildcard.mixed.qos/server.rpt @@ -230,8 +230,10 @@ read advised zilla:flush ${kafka:matchFlushEx() .consumer() .progress(0, 3, mqtt_kafka:subscribeMetadata() - .metadata(2) - .build()) + .v2() + .metadata(2) + .build() + .build()) .correlationId(2) .build() .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.qos2/client.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.qos2/client.rpt index 2e02f04bc9..416256b334 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.qos2/client.rpt +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.qos2/client.rpt @@ -138,8 +138,10 @@ write advise zilla:flush ${kafka:flushEx() .consumer() .progress(0, 3, mqtt_kafka:subscribeMetadata() + .v2() .metadata(1) - .build()) + .build() + .build()) .correlationId(1) .build() .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.qos2/server.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.qos2/server.rpt index bb3cf4daba..b0fc95ef7a 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.qos2/server.rpt +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.message.qos2/server.rpt @@ -138,8 +138,10 @@ read advised zilla:flush ${kafka:matchFlushEx() .consumer() .progress(0, 3, mqtt_kafka:subscribeMetadata() + .v2() .metadata(1) - .build()) + .build() + .build()) .correlationId(1) .build() .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.messages.mixture.qos/client.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.messages.mixture.qos/client.rpt index 34ca570c6f..bd47cb6410 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.messages.mixture.qos/client.rpt +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.messages.mixture.qos/client.rpt @@ -190,8 +190,10 @@ write advise zilla:flush ${kafka:flushEx() .consumer() .progress(0, 5, mqtt_kafka:subscribeMetadata() - .metadata(2) - .build()) + .v2() + .metadata(2) + .build() + .build()) .correlationId(2) .build() .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.messages.mixture.qos/server.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.messages.mixture.qos/server.rpt index 89fd7a8a61..bd52691d33 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.messages.mixture.qos/server.rpt +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.receive.messages.mixture.qos/server.rpt @@ -196,8 +196,10 @@ read advised zilla:flush ${kafka:matchFlushEx() .consumer() .progress(0, 5, mqtt_kafka:subscribeMetadata() - .metadata(2) - .build()) + .v2() + .metadata(2) + .build() + .build()) .correlationId(2) .build() .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.incomplete.message/client.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.incomplete.message/client.rpt index 77e749c090..c74893d15b 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.incomplete.message/client.rpt +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.incomplete.message/client.rpt @@ -142,8 +142,10 @@ write advise zilla:flush ${kafka:flushEx() .consumer() .progress(0, 3, mqtt_kafka:subscribeMetadata() - .metadata(1) - .build()) + .v2() + .metadata(1) + .build() + .build()) .correlationId(1) .build() .build()} @@ -250,8 +252,10 @@ read zilla:begin.ext ${kafka:matchBeginEx() .capabilities("FETCH_ONLY") .topic("mqtt-messages") .partition(0, 2, 3, 3, mqtt_kafka:subscribeMetadata() - .metadata(1) - .build()) + .v2() + .metadata(1) + .build() + .build()) .build() .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.incomplete.message/server.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.incomplete.message/server.rpt index 052bff1ecc..fd729f39a0 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.incomplete.message/server.rpt +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.incomplete.message/server.rpt @@ -142,8 +142,10 @@ read advised zilla:flush ${kafka:matchFlushEx() .consumer() .progress(0, 3, mqtt_kafka:subscribeMetadata() - .metadata(1) - .build()) + .v2() + .metadata(1) + .build() + .build()) .correlationId(1) .build() .build()} @@ -240,8 +242,10 @@ write zilla:begin.ext ${kafka:beginEx() .capabilities("FETCH_ONLY") .topic("mqtt-messages") .partition(0, 2, 3, 3, mqtt_kafka:subscribeMetadata() - .metadata(1) - .build()) + .v2() + .metadata(1) + .build() + .build()) .build() .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.unreceived.message/client.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.unreceived.message/client.rpt index 1183e456e7..ff5b94c545 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.unreceived.message/client.rpt +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.unreceived.message/client.rpt @@ -268,8 +268,10 @@ write advise zilla:flush ${kafka:flushEx() .consumer() .progress(0, 3, mqtt_kafka:subscribeMetadata() - .metadata(2) - .build()) + .v2() + .metadata(2) + .build() + .build()) .correlationId(2) .build() .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.unreceived.message/server.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.unreceived.message/server.rpt index 8e881de11b..5432b60077 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.unreceived.message/server.rpt +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.reconnect.replay.qos2.unreceived.message/server.rpt @@ -260,8 +260,10 @@ read advised zilla:flush ${kafka:matchFlushEx() .consumer() .progress(0, 3, mqtt_kafka:subscribeMetadata() - .metadata(2) - .build()) + .v2() + .metadata(2) + .build() + .build()) .correlationId(2) .build() .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.replay.retained.message.qos2/client.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.replay.retained.message.qos2/client.rpt index faaed22e95..486622e4d6 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.replay.retained.message.qos2/client.rpt +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.replay.retained.message.qos2/client.rpt @@ -218,8 +218,10 @@ write advise zilla:flush ${kafka:flushEx() .consumer() .progress(0, 3, mqtt_kafka:subscribeMetadata() - .metadata(1) - .build()) + .v2() + .metadata(1) + .build() + .build()) .correlationId(1) .build() .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.replay.retained.message.qos2/server.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.replay.retained.message.qos2/server.rpt index 9ce6f74566..83b365e3c0 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.replay.retained.message.qos2/server.rpt +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/kafka/subscribe.replay.retained.message.qos2/server.rpt @@ -212,8 +212,10 @@ read advised zilla:flush ${kafka:matchFlushEx() .consumer() .progress(0, 3, mqtt_kafka:subscribeMetadata() - .metadata(1) - .build()) + .v2() + .metadata(1) + .build() + .build()) .correlationId(1) .build() .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/mqtt/subscribe.qos2.version1.offset.metadata/client.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/mqtt/subscribe.qos2.version1.offset.metadata/client.rpt new file mode 100644 index 0000000000..57bd5f0435 --- /dev/null +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/mqtt/subscribe.qos2.version1.offset.metadata/client.rpt @@ -0,0 +1,65 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "zilla://streams/mqtt0" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${mqtt:beginEx() + .typeId(zilla:id("mqtt")) + .subscribe() + .clientId("client") + .qos("EXACTLY_ONCE") + .filter("sensor/one", 1, "EXACTLY_ONCE") + .build() + .build()} + +connected + +read zilla:data.ext ${mqtt:matchDataEx() + .typeId(zilla:id("mqtt")) + .subscribe() + .topic("sensor/one") + .packetId(1) + .qos("EXACTLY_ONCE") + .subscriptionId(1) + .format("TEXT") + .build() + .build()} +read "message" + +write advise zilla:flush ${mqtt:flushEx() + .typeId(zilla:id("mqtt")) + .subscribe() + .qos("EXACTLY_ONCE") + .packetId(1) + .state("INCOMPLETE") + .build() + .build()} + +read advised zilla:flush ${mqtt:flushEx() + .typeId(zilla:id("mqtt")) + .subscribe() + .packetId(1) + .build() + .build()} + +write advise zilla:flush ${mqtt:flushEx() + .typeId(zilla:id("mqtt")) + .subscribe() + .qos("EXACTLY_ONCE") + .packetId(1) + .build() + .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/mqtt/subscribe.qos2.version1.offset.metadata/server.rpt b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/mqtt/subscribe.qos2.version1.offset.metadata/server.rpt new file mode 100644 index 0000000000..a8ac75fd8c --- /dev/null +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/mqtt/subscribe.qos2.version1.offset.metadata/server.rpt @@ -0,0 +1,67 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "zilla://streams/mqtt0" + option zilla:window 8192 + option zilla:transmission "duplex" + +accepted + +read zilla:begin.ext ${mqtt:matchBeginEx() + .typeId(zilla:id("mqtt")) + .subscribe() + .clientId("client") + .qos("EXACTLY_ONCE") + .filter("sensor/one", 1, "EXACTLY_ONCE") + .build() + .build()} + +connected + +write zilla:data.ext ${mqtt:dataEx() + .typeId(zilla:id("mqtt")) + .subscribe() + .topic("sensor/one") + .packetId(1) + .qos("EXACTLY_ONCE") + .subscriptionId(1) + .format("TEXT") + .build() + .build()} +write "message" + +read advised zilla:flush ${mqtt:flushEx() + .typeId(zilla:id("mqtt")) + .subscribe() + .qos("EXACTLY_ONCE") + .packetId(1) + .state("INCOMPLETE") + .build() + .build()} + +write advise zilla:flush ${mqtt:flushEx() + .typeId(zilla:id("mqtt")) + .subscribe() + .packetId(1) + .build() + .build()} + +read advised zilla:flush ${mqtt:flushEx() + .typeId(zilla:id("mqtt")) + .subscribe() + .qos("EXACTLY_ONCE") + .packetId(1) + .build() + .build()} diff --git a/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/config/SchemaTest.java b/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/config/SchemaTest.java index 1231924225..ab35535c80 100644 --- a/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/config/SchemaTest.java +++ b/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/config/SchemaTest.java @@ -49,6 +49,14 @@ public void shouldValidateProxyWithOptions() assertThat(config, not(nullValue())); } + @Test + public void shouldValidateProxyWithPublishQosMax() + { + JsonObject config = schema.validate("proxy.publish.qos.max.yaml"); + + assertThat(config, not(nullValue())); + } + @Test public void shouldValidateProxyWhenPublishTopicWithMessages() { diff --git a/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/internal/MqttKafkaFunctionsTest.java b/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/internal/MqttKafkaFunctionsTest.java index d8a121a61f..d15ea33c29 100644 --- a/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/internal/MqttKafkaFunctionsTest.java +++ b/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/internal/MqttKafkaFunctionsTest.java @@ -37,21 +37,45 @@ public void shouldGetMapper() assertEquals("mqtt_kafka", mapper.getPrefixName()); } @Test - public void shouldEncodeMqttOffsetMetadata() + public void shouldEncodeMqttOffsetMetadataV1() { final String state = MqttKafkaFunctions.subscribeMetadata() - .metadata(1) - .metadata(2) + .v1() + .metadata(10) + .metadata(14) + .metadata(15) + .build() .build(); final IntArrayList metadataList = new IntArrayList(); UnsafeBuffer buffer = new UnsafeBuffer(BitUtil.fromHex(state)); MqttSubscribeOffsetMetadataFW offsetMetadata = new MqttSubscribeOffsetMetadataFW().wrap(buffer, 0, buffer.capacity()); - offsetMetadata.packetIds().forEachRemaining((IntConsumer) metadataList::add); + offsetMetadata.subscribeMetadataV1().packetIds().forEachRemaining((IntConsumer) metadataList::add); - assertEquals(1, offsetMetadata.version()); - assertEquals(1, (int) metadataList.get(0)); - assertEquals(2, (int) metadataList.get(1)); + assertEquals(10, (int) metadataList.get(0)); + assertEquals(14, (int) metadataList.get(1)); + assertEquals(15, (int) metadataList.get(2)); + } + + @Test + public void shouldEncodeMqttOffsetMetadataV2() + { + final String state = MqttKafkaFunctions.subscribeMetadata() + .v2() + .metadata(10) + .metadata(14) + .metadata(15) + .build() + .build(); + + final IntArrayList metadataList = new IntArrayList(); + UnsafeBuffer buffer = new UnsafeBuffer(BitUtil.fromHex(state)); + MqttSubscribeOffsetMetadataFW offsetMetadata = new MqttSubscribeOffsetMetadataFW().wrap(buffer, 0, buffer.capacity()); + offsetMetadata.subscribeMetadataV2().packetIds().forEachRemaining((IntConsumer) metadataList::add); + + assertEquals(10, (int) metadataList.get(0)); + assertEquals(14, (int) metadataList.get(1)); + assertEquals(15, (int) metadataList.get(2)); } @Test diff --git a/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/KafkaIT.java b/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/KafkaIT.java index 76b2d69056..4bb2e16b56 100644 --- a/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/KafkaIT.java +++ b/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/KafkaIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class KafkaIT { @@ -1005,6 +1006,15 @@ public void shouldReceiveMessageQoS2() throws Exception k3po.finish(); } + @Test + @Specification({ + "${kafka}/subscribe.qos2.version1.offset.metadata/client", + "${kafka}/subscribe.qos2.version1.offset.metadata/server"}) + public void shouldReceiveMessageQoS2WithVersion1OffsetMetadata() throws Exception + { + k3po.finish(); + } + @Test @Specification({ "${kafka}/subscribe.receive.messages.mixture.qos/client", diff --git a/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/MqttIT.java b/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/MqttIT.java index 006a056988..2ff6efcb53 100644 --- a/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/MqttIT.java +++ b/specs/binding-mqtt-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/kafka/streams/MqttIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class MqttIT { @@ -791,6 +792,15 @@ public void shouldReceiveMessageQoS2() throws Exception k3po.finish(); } + @Test + @Specification({ + "${mqtt}/subscribe.qos2.version1.offset.metadata/client", + "${mqtt}/subscribe.qos2.version1.offset.metadata/server"}) + public void shouldReceiveMessageQoS2WithVersion1OffsetMetadata() throws Exception + { + k3po.finish(); + } + @Test @Specification({ "${mqtt}/subscribe.receive.messages.mixture.qos/client", diff --git a/specs/binding-mqtt.spec/pom.xml b/specs/binding-mqtt.spec/pom.xml index e072cace5f..c31fede4c5 100644 --- a/specs/binding-mqtt.spec/pom.xml +++ b/specs/binding-mqtt.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 0.94 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -110,7 +108,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-mqtt.spec/src/main/java/io/aklivity/zilla/specs/binding/mqtt/internal/MqttFunctions.java b/specs/binding-mqtt.spec/src/main/java/io/aklivity/zilla/specs/binding/mqtt/internal/MqttFunctions.java index 42d726c4e7..8f4bcc3b5c 100644 --- a/specs/binding-mqtt.spec/src/main/java/io/aklivity/zilla/specs/binding/mqtt/internal/MqttFunctions.java +++ b/specs/binding-mqtt.spec/src/main/java/io/aklivity/zilla/specs/binding/mqtt/internal/MqttFunctions.java @@ -29,10 +29,10 @@ import org.agrona.DirectBuffer; import org.agrona.MutableDirectBuffer; import org.agrona.concurrent.UnsafeBuffer; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.specs.binding.mqtt.internal.types.Array32FW; import io.aklivity.zilla.specs.binding.mqtt.internal.types.MqttBinaryFW; import io.aklivity.zilla.specs.binding.mqtt.internal.types.MqttExpirySignalFW; diff --git a/specs/binding-mqtt.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/binding-mqtt.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/binding-mqtt.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/binding-mqtt.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml b/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml index 53d5edc154..d321882e7e 100644 --- a/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml +++ b/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.mqtt.client.connected - message: CLIENT_CONNECTED - client + name: BINDING_MQTT_CLIENT_CONNECTED + message: Session authorization (-) was successful for client id (client). bindings: net0: type: mqtt diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/internal/MqttFunctionsTest.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/internal/MqttFunctionsTest.java index ca08c29173..0e1dfc0fe0 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/internal/MqttFunctionsTest.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/internal/MqttFunctionsTest.java @@ -27,8 +27,8 @@ import org.agrona.DirectBuffer; import org.agrona.concurrent.UnsafeBuffer; import org.junit.Test; -import org.kaazing.k3po.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; import io.aklivity.zilla.specs.binding.mqtt.internal.types.MqttPayloadFormat; import io.aklivity.zilla.specs.binding.mqtt.internal.types.MqttSessionSignalFW; import io.aklivity.zilla.specs.binding.mqtt.internal.types.MqttSessionSignalType; diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/ConnectionIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/ConnectionIT.java index 1a3c0bd3c2..036ee79b53 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/ConnectionIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/ConnectionIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ConnectionIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/PublishIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/PublishIT.java index ed026cb317..3e5c4482fe 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/PublishIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/PublishIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class PublishIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/SessionIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/SessionIT.java index 213924acba..a8c040eeff 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/SessionIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/SessionIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class SessionIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/SubscribeIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/SubscribeIT.java index 5d6c2e266f..28ab1283a7 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/SubscribeIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/SubscribeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class SubscribeIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/UnsubscribeIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/UnsubscribeIT.java index d52937fc19..c7f41696ae 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/UnsubscribeIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/application/UnsubscribeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class UnsubscribeIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/ConnectionIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/ConnectionIT.java index ec484b0058..7e36faf4c0 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/ConnectionIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/ConnectionIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ConnectionIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/PingIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/PingIT.java index 60b4a25473..eb9cd4bbd2 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/PingIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/PingIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class PingIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/PublishIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/PublishIT.java index 1a10ec6d58..e1f6a33d3f 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/PublishIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/PublishIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class PublishIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/SessionIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/SessionIT.java index a9855be4c4..1a62c48ecb 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/SessionIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/SessionIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class SessionIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/SubscribeIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/SubscribeIT.java index c939cc213f..4b35664a8a 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/SubscribeIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/SubscribeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class SubscribeIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/UnsubscribeIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/UnsubscribeIT.java index f48028f4a5..64ec1c3815 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/UnsubscribeIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v4/UnsubscribeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class UnsubscribeIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/ConnectionIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/ConnectionIT.java index 9e01f02441..85b463f545 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/ConnectionIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/ConnectionIT.java @@ -24,8 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ConnectionIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/PingIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/PingIT.java index 2d1394a32c..a42edffe24 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/PingIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/PingIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class PingIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/PublishIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/PublishIT.java index fa791d4288..eb90a677d6 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/PublishIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/PublishIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class PublishIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/SessionIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/SessionIT.java index c9dcfa4a66..21b11aa3ad 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/SessionIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/SessionIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class SessionIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/SubscribeIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/SubscribeIT.java index f815cca22d..ad5818426c 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/SubscribeIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/SubscribeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class SubscribeIT { diff --git a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/UnsubscribeIT.java b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/UnsubscribeIT.java index dc4f0d0b76..7a252cbb8e 100644 --- a/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/UnsubscribeIT.java +++ b/specs/binding-mqtt.spec/src/test/java/io/aklivity/zilla/specs/binding/mqtt/streams/network/v5/UnsubscribeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class UnsubscribeIT { diff --git a/specs/binding-openapi-asyncapi.spec/NOTICE b/specs/binding-openapi-asyncapi.spec/NOTICE index 0f86481145..be00bb202c 100644 --- a/specs/binding-openapi-asyncapi.spec/NOTICE +++ b/specs/binding-openapi-asyncapi.spec/NOTICE @@ -21,6 +21,7 @@ This project includes: zilla::specs::binding-mqtt.spec under The Apache Software License, Version 2.0 zilla::specs::binding-openapi.spec under The Apache Software License, Version 2.0 zilla::specs::binding-proxy.spec under The Apache Software License, Version 2.0 + zilla::specs::binding-sse.spec under The Apache Software License, Version 2.0 zilla::specs::binding-tcp.spec under The Apache Software License, Version 2.0 zilla::specs::binding-tls.spec under The Apache Software License, Version 2.0 zilla::specs::engine.spec under The Apache Software License, Version 2.0 diff --git a/specs/binding-openapi-asyncapi.spec/pom.xml b/specs/binding-openapi-asyncapi.spec/pom.xml index 0c4350528c..69315d6c21 100644 --- a/specs/binding-openapi-asyncapi.spec/pom.xml +++ b/specs/binding-openapi-asyncapi.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 0.96 1 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -67,8 +65,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -130,7 +128,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-openapi-asyncapi.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/binding-openapi-asyncapi.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/binding-openapi-asyncapi.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/binding-openapi-asyncapi.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/binding-openapi-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/asyncapi/streams/AsyncapiIT.java b/specs/binding-openapi-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/asyncapi/streams/AsyncapiIT.java index d24c884e9c..c09ba0de4a 100644 --- a/specs/binding-openapi-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/asyncapi/streams/AsyncapiIT.java +++ b/specs/binding-openapi-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/asyncapi/streams/AsyncapiIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AsyncapiIT { diff --git a/specs/binding-openapi-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/asyncapi/streams/OpenapiIT.java b/specs/binding-openapi-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/asyncapi/streams/OpenapiIT.java index 44743959bc..bf7c46a678 100644 --- a/specs/binding-openapi-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/asyncapi/streams/OpenapiIT.java +++ b/specs/binding-openapi-asyncapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/asyncapi/streams/OpenapiIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class OpenapiIT { diff --git a/specs/binding-openapi.spec/pom.xml b/specs/binding-openapi.spec/pom.xml index 958dbfb6fa..4f692bce4b 100644 --- a/specs/binding-openapi.spec/pom.xml +++ b/specs/binding-openapi.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 0.91 1 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -62,8 +60,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -125,7 +123,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-openapi.spec/src/main/java/io/aklivity/zilla/specs/binding/openapi/OpenapiFunctions.java b/specs/binding-openapi.spec/src/main/java/io/aklivity/zilla/specs/binding/openapi/OpenapiFunctions.java index d06d407f29..571e3c8100 100644 --- a/specs/binding-openapi.spec/src/main/java/io/aklivity/zilla/specs/binding/openapi/OpenapiFunctions.java +++ b/specs/binding-openapi.spec/src/main/java/io/aklivity/zilla/specs/binding/openapi/OpenapiFunctions.java @@ -21,10 +21,10 @@ import org.agrona.DirectBuffer; import org.agrona.MutableDirectBuffer; import org.agrona.concurrent.UnsafeBuffer; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.specs.binding.openapi.internal.types.OctetsFW; import io.aklivity.zilla.specs.binding.openapi.internal.types.stream.OpenapiBeginExFW; diff --git a/specs/binding-openapi.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/binding-openapi.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/binding-openapi.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/binding-openapi.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/binding-openapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/internal/OpenapiFunctionsTest.java b/specs/binding-openapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/internal/OpenapiFunctionsTest.java index 8624a3c0ee..97d4c1b0d8 100644 --- a/specs/binding-openapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/internal/OpenapiFunctionsTest.java +++ b/specs/binding-openapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/internal/OpenapiFunctionsTest.java @@ -29,9 +29,9 @@ import org.agrona.MutableDirectBuffer; import org.agrona.concurrent.UnsafeBuffer; import org.junit.Test; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.internal.el.ExpressionContext; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.internal.el.ExpressionContext; import io.aklivity.zilla.specs.binding.openapi.OpenapiFunctions; import io.aklivity.zilla.specs.binding.openapi.internal.types.OctetsFW; import io.aklivity.zilla.specs.binding.openapi.internal.types.stream.OpenapiBeginExFW; diff --git a/specs/binding-openapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/streams/HttpIT.java b/specs/binding-openapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/streams/HttpIT.java index d1168fd2fd..16db2f941d 100644 --- a/specs/binding-openapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/streams/HttpIT.java +++ b/specs/binding-openapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/streams/HttpIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class HttpIT { diff --git a/specs/binding-openapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/streams/OpenapiIT.java b/specs/binding-openapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/streams/OpenapiIT.java index bc90e1c7b6..cd80832ee4 100644 --- a/specs/binding-openapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/streams/OpenapiIT.java +++ b/specs/binding-openapi.spec/src/test/java/io/aklivity/zilla/specs/binding/openapi/streams/OpenapiIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class OpenapiIT { diff --git a/specs/binding-proxy.spec/pom.xml b/specs/binding-proxy.spec/pom.xml index d16011e6c8..a2bc509527 100644 --- a/specs/binding-proxy.spec/pom.xml +++ b/specs/binding-proxy.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -109,7 +107,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-proxy.spec/src/main/java/io/aklivity/zilla/specs/binding/proxy/internal/ProxyFunctions.java b/specs/binding-proxy.spec/src/main/java/io/aklivity/zilla/specs/binding/proxy/internal/ProxyFunctions.java index f7769f286a..f86d7c6437 100644 --- a/specs/binding-proxy.spec/src/main/java/io/aklivity/zilla/specs/binding/proxy/internal/ProxyFunctions.java +++ b/specs/binding-proxy.spec/src/main/java/io/aklivity/zilla/specs/binding/proxy/internal/ProxyFunctions.java @@ -42,10 +42,10 @@ import org.agrona.MutableDirectBuffer; import org.agrona.collections.MutableInteger; import org.agrona.concurrent.UnsafeBuffer; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.specs.binding.proxy.internal.types.Array32FW; import io.aklivity.zilla.specs.binding.proxy.internal.types.OctetsFW; import io.aklivity.zilla.specs.binding.proxy.internal.types.ProxyAddressFW; diff --git a/specs/binding-proxy.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/binding-proxy.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/binding-proxy.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/binding-proxy.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/binding-proxy.spec/src/test/java/io/aklivity/zilla/specs/binding/proxy/internal/ProxyFunctionsTest.java b/specs/binding-proxy.spec/src/test/java/io/aklivity/zilla/specs/binding/proxy/internal/ProxyFunctionsTest.java index 94248ed4e9..d18e22acce 100644 --- a/specs/binding-proxy.spec/src/test/java/io/aklivity/zilla/specs/binding/proxy/internal/ProxyFunctionsTest.java +++ b/specs/binding-proxy.spec/src/test/java/io/aklivity/zilla/specs/binding/proxy/internal/ProxyFunctionsTest.java @@ -47,9 +47,9 @@ import org.agrona.DirectBuffer; import org.agrona.concurrent.UnsafeBuffer; import org.junit.Test; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.internal.el.ExpressionContext; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.internal.el.ExpressionContext; import io.aklivity.zilla.specs.binding.proxy.internal.types.ProxyInfoFW; import io.aklivity.zilla.specs.binding.proxy.internal.types.stream.ProxyBeginExFW; diff --git a/specs/binding-proxy.spec/src/test/java/io/aklivity/zilla/specs/binding/proxy/streams/ApplicationIT.java b/specs/binding-proxy.spec/src/test/java/io/aklivity/zilla/specs/binding/proxy/streams/ApplicationIT.java index 94bedf0d83..14009cf903 100644 --- a/specs/binding-proxy.spec/src/test/java/io/aklivity/zilla/specs/binding/proxy/streams/ApplicationIT.java +++ b/specs/binding-proxy.spec/src/test/java/io/aklivity/zilla/specs/binding/proxy/streams/ApplicationIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ApplicationIT { diff --git a/specs/binding-proxy.spec/src/test/java/io/aklivity/zilla/specs/binding/proxy/streams/NetworkIT.java b/specs/binding-proxy.spec/src/test/java/io/aklivity/zilla/specs/binding/proxy/streams/NetworkIT.java index c503846cbe..90bc9c392c 100644 --- a/specs/binding-proxy.spec/src/test/java/io/aklivity/zilla/specs/binding/proxy/streams/NetworkIT.java +++ b/specs/binding-proxy.spec/src/test/java/io/aklivity/zilla/specs/binding/proxy/streams/NetworkIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class NetworkIT { diff --git a/specs/binding-sse-kafka.spec/pom.xml b/specs/binding-sse-kafka.spec/pom.xml index 18a0a5df34..afd0f8fd83 100644 --- a/specs/binding-sse-kafka.spec/pom.xml +++ b/specs/binding-sse-kafka.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -52,8 +50,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -115,7 +113,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-sse-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/kafka/streams/KafkaIT.java b/specs/binding-sse-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/kafka/streams/KafkaIT.java index aec78b65c9..548520c2a0 100644 --- a/specs/binding-sse-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/kafka/streams/KafkaIT.java +++ b/specs/binding-sse-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/kafka/streams/KafkaIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class KafkaIT { diff --git a/specs/binding-sse-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/kafka/streams/SseIT.java b/specs/binding-sse-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/kafka/streams/SseIT.java index b3d3d92aa7..3bca59e3b1 100644 --- a/specs/binding-sse-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/kafka/streams/SseIT.java +++ b/specs/binding-sse-kafka.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/kafka/streams/SseIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class SseIT { diff --git a/specs/binding-sse.spec/pom.xml b/specs/binding-sse.spec/pom.xml index 3414860f83..f60d6bc924 100644 --- a/specs/binding-sse.spec/pom.xml +++ b/specs/binding-sse.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -110,7 +108,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-sse.spec/src/main/java/io/aklivity/zilla/specs/binding/sse/internal/SseFunctions.java b/specs/binding-sse.spec/src/main/java/io/aklivity/zilla/specs/binding/sse/internal/SseFunctions.java index d4711d2fce..4962f7f721 100644 --- a/specs/binding-sse.spec/src/main/java/io/aklivity/zilla/specs/binding/sse/internal/SseFunctions.java +++ b/specs/binding-sse.spec/src/main/java/io/aklivity/zilla/specs/binding/sse/internal/SseFunctions.java @@ -22,10 +22,10 @@ import org.agrona.DirectBuffer; import org.agrona.MutableDirectBuffer; import org.agrona.concurrent.UnsafeBuffer; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.specs.binding.sse.internal.types.String8FW; import io.aklivity.zilla.specs.binding.sse.internal.types.stream.SseBeginExFW; import io.aklivity.zilla.specs.binding.sse.internal.types.stream.SseDataExFW; diff --git a/specs/binding-sse.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/binding-sse.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/binding-sse.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/binding-sse.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/config/server.validator.yaml b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/config/server.validator.yaml new file mode 100644 index 0000000000..b5d951d68e --- /dev/null +++ b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/config/server.validator.yaml @@ -0,0 +1,32 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +--- +name: test +bindings: + net0: + type: sse + kind: server + options: + requests: + - path: /events/* + content: + model: test + length: 13 + routes: + - exit: app0 + when: + - path: /events/* diff --git a/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/schema/sse.schema.patch.json b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/schema/sse.schema.patch.json index 78927ab368..b170bb578c 100644 --- a/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/schema/sse.schema.patch.json +++ b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/schema/sse.schema.patch.json @@ -40,6 +40,36 @@ { "type": "integer", "default": 2000 + }, + "requests": + { + "type": "array", + "items": + { + "type": "object", + "properties": + { + "path": + { + "type": "string" + }, + "content": + { + "$ref": "#/$defs/validator" + } + }, + "anyOf": + [ + { + "required": + [ + "path", + "content" + ] + } + ], + "additionalProperties": false + } } }, "additionalProperties": false diff --git a/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/application/data/invalid/client.rpt b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/application/data/invalid/client.rpt new file mode 100644 index 0000000000..fd264ab84e --- /dev/null +++ b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/application/data/invalid/client.rpt @@ -0,0 +1,32 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +connect "zilla://streams/app0" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${sse:beginEx() + .typeId(zilla:id("sse")) + .scheme("http") + .authority("localhost:8080") + .path("/events/a8b7c6d5") + .lastId(null) + .build()} + +connected + +read "Hello world" + diff --git a/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/application/data/invalid/server.rpt b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/application/data/invalid/server.rpt new file mode 100644 index 0000000000..91d54b81c8 --- /dev/null +++ b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/application/data/invalid/server.rpt @@ -0,0 +1,34 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +accept "zilla://streams/app0" + option zilla:window 8192 + option zilla:transmission "duplex" +accepted + +read zilla:begin.ext ${sse:beginEx() + .typeId(zilla:id("sse")) + .scheme("http") + .authority("localhost:8080") + .path("/events/a8b7c6d5") + .lastId(null) + .build()} + +connected + +write "Hello world" +write flush + diff --git a/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/application/data/valid/client.rpt b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/application/data/valid/client.rpt new file mode 100644 index 0000000000..3f5bdf3979 --- /dev/null +++ b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/application/data/valid/client.rpt @@ -0,0 +1,34 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +connect "zilla://streams/app0" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${sse:beginEx() + .typeId(zilla:id("sse")) + .scheme("http") + .authority("localhost:8080") + .path("/events/a8b7c6d5") + .lastId(null) + .build()} + +connected + +read "Hello world" + +read "Hello, world!" + diff --git a/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/application/data/valid/server.rpt b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/application/data/valid/server.rpt new file mode 100644 index 0000000000..66654cab73 --- /dev/null +++ b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/application/data/valid/server.rpt @@ -0,0 +1,36 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +accept "zilla://streams/app0" + option zilla:window 8192 + option zilla:transmission "duplex" +accepted + +read zilla:begin.ext ${sse:beginEx() + .typeId(zilla:id("sse")) + .scheme("http") + .authority("localhost:8080") + .path("/events/a8b7c6d5") + .lastId(null) + .build()} + +connected + +write "Hello world" +write flush + +write "Hello, world!" +write flush diff --git a/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/network/data/invalid/request.rpt b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/network/data/invalid/request.rpt new file mode 100644 index 0000000000..695867c449 --- /dev/null +++ b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/network/data/invalid/request.rpt @@ -0,0 +1,38 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +connect "zilla://streams/net0" + option zilla:window 8192 + option zilla:transmission "half-duplex" + +write zilla:begin.ext ${http:beginEx() + .typeId(zilla:id("http")) + .header(":method", "GET") + .header(":scheme", "http") + .header(":authority", "localhost:8080") + .header(":path", "/events/a8b7c6d5") + .header("accept", "text/event-stream") + .build()} + +connected + +write close + +read zilla:begin.ext ${http:beginEx() + .typeId(zilla:id("http")) + .header(":status", "200") + .header("content-type", "text/event-stream") + .build()} diff --git a/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/network/data/invalid/response.rpt b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/network/data/invalid/response.rpt new file mode 100644 index 0000000000..4d6bffea03 --- /dev/null +++ b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/network/data/invalid/response.rpt @@ -0,0 +1,40 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +accept "zilla://streams/net0" + option zilla:window 8192 + option zilla:transmission "half-duplex" +accepted + +read zilla:begin.ext ${http:beginEx() + .typeId(zilla:id("http")) + .header(":method", "GET") + .header(":scheme", "http") + .header(":authority", "localhost:8080") + .header(":path", "/events/a8b7c6d5") + .header("accept", "text/event-stream") + .build()} + +connected + +read closed + +write zilla:begin.ext ${http:beginEx() + .typeId(zilla:id("http")) + .header(":status", "200") + .header("content-type", "text/event-stream") + .build()} +write flush diff --git a/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/network/data/valid/request.rpt b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/network/data/valid/request.rpt new file mode 100644 index 0000000000..ca38b630f2 --- /dev/null +++ b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/network/data/valid/request.rpt @@ -0,0 +1,41 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +connect "zilla://streams/net0" + option zilla:window 8192 + option zilla:transmission "half-duplex" + +write zilla:begin.ext ${http:beginEx() + .typeId(zilla:id("http")) + .header(":method", "GET") + .header(":scheme", "http") + .header(":authority", "localhost:8080") + .header(":path", "/events/a8b7c6d5") + .header("accept", "text/event-stream") + .build()} + +connected + +write close + +read zilla:begin.ext ${http:beginEx() + .typeId(zilla:id("http")) + .header(":status", "200") + .header("content-type", "text/event-stream") + .build()} + +read "data:Hello, world!\n" +read "\n" diff --git a/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/network/data/valid/response.rpt b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/network/data/valid/response.rpt new file mode 100644 index 0000000000..ffb1084914 --- /dev/null +++ b/specs/binding-sse.spec/src/main/scripts/io/aklivity/zilla/specs/binding/sse/streams/network/data/valid/response.rpt @@ -0,0 +1,44 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +accept "zilla://streams/net0" + option zilla:window 8192 + option zilla:transmission "half-duplex" +accepted + +read zilla:begin.ext ${http:beginEx() + .typeId(zilla:id("http")) + .header(":method", "GET") + .header(":scheme", "http") + .header(":authority", "localhost:8080") + .header(":path", "/events/a8b7c6d5") + .header("accept", "text/event-stream") + .build()} + +connected + +read closed + +write zilla:begin.ext ${http:beginEx() + .typeId(zilla:id("http")) + .header(":status", "200") + .header("content-type", "text/event-stream") + .build()} +write flush + +write "data:Hello, world!\n" +write "\n" +write flush diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/config/SchemaTest.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/config/SchemaTest.java index aabfefb7b8..546e723529 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/config/SchemaTest.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/config/SchemaTest.java @@ -31,6 +31,7 @@ public class SchemaTest @Rule public final ConfigSchemaRule schema = new ConfigSchemaRule() .schemaPatch("io/aklivity/zilla/specs/binding/sse/schema/sse.schema.patch.json") + .schemaPatch("io/aklivity/zilla/specs/engine/schema/model/test.schema.patch.json") .configurationRoot("io/aklivity/zilla/specs/binding/sse/config"); @Test @@ -48,4 +49,12 @@ public void shouldValidateServerWhen() assertThat(config, not(nullValue())); } + + @Test + public void shouldValidateServerWithValidator() + { + JsonObject config = schema.validate("server.validator.yaml"); + + assertThat(config, not(nullValue())); + } } diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/internal/SseFunctionsTest.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/internal/SseFunctionsTest.java index d160370f15..f96c038a88 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/internal/SseFunctionsTest.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/internal/SseFunctionsTest.java @@ -15,11 +15,11 @@ */ package io.aklivity.zilla.specs.binding.sse.internal; +import static io.aklivity.k3po.runtime.lang.internal.el.ExpressionFactoryUtils.newExpressionFactory; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThrows; -import static org.kaazing.k3po.lang.internal.el.ExpressionFactoryUtils.newExpressionFactory; import java.nio.ByteBuffer; @@ -31,9 +31,9 @@ import org.agrona.concurrent.UnsafeBuffer; import org.junit.Before; import org.junit.Test; -import org.kaazing.k3po.lang.el.BytesMatcher; -import org.kaazing.k3po.lang.internal.el.ExpressionContext; +import io.aklivity.k3po.runtime.lang.el.BytesMatcher; +import io.aklivity.k3po.runtime.lang.internal.el.ExpressionContext; import io.aklivity.zilla.specs.binding.sse.internal.types.stream.SseBeginExFW; import io.aklivity.zilla.specs.binding.sse.internal.types.stream.SseDataExFW; import io.aklivity.zilla.specs.binding.sse.internal.types.stream.SseEndExFW; diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/AdvisoryIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/AdvisoryIT.java index f8710bcfee..a2ff4b82f9 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/AdvisoryIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/AdvisoryIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AdvisoryIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/ByteOrderMarkIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/ByteOrderMarkIT.java index 1cef85b479..fb60efa5f5 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/ByteOrderMarkIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/ByteOrderMarkIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ByteOrderMarkIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/DataIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/DataIT.java index c650c5554a..acd5c55ba2 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/DataIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/DataIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class DataIT { @@ -72,6 +73,24 @@ public void shouldReceiveMultipleData() throws Exception k3po.finish(); } + @Test + @Specification({ + "${app}/valid/client", + "${app}/valid/server" }) + public void shouldReceiveValidMessage() throws Exception + { + k3po.finish(); + } + + @Test + @Specification({ + "${app}/invalid/client", + "${app}/invalid/server" }) + public void shouldNotReceiveInvalidMessage() throws Exception + { + k3po.finish(); + } + @Test @Specification({ "${app}/fragmented.10k/client", diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/EndOfLineIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/EndOfLineIT.java index 79d9a80316..bd96e91c6e 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/EndOfLineIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/EndOfLineIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class EndOfLineIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/ErrorIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/ErrorIT.java index 51683c7028..007e866941 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/ErrorIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/ErrorIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ErrorIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/HandshakeIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/HandshakeIT.java index 91d38b9fb5..ae63d742a3 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/HandshakeIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/HandshakeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class HandshakeIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/IdIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/IdIT.java index 2b8fecda4b..35c0a38b11 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/IdIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/IdIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class IdIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/ReconnectIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/ReconnectIT.java index 270de349ff..f96f321f74 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/ReconnectIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/ReconnectIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ReconnectIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/TypeIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/TypeIT.java index 56f5a0a248..3a5ec6dfe0 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/TypeIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/application/TypeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class TypeIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/AdvisoryIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/AdvisoryIT.java index f04475ffa4..7fe2dcae67 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/AdvisoryIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/AdvisoryIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AdvisoryIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ByteOrderMarkIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ByteOrderMarkIT.java index 2c4cd2bef6..dffc4dd863 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ByteOrderMarkIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ByteOrderMarkIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ByteOrderMarkIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ChallengeIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ChallengeIT.java index e4b5a4e948..9af923cdf4 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ChallengeIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ChallengeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ChallengeIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/CommentIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/CommentIT.java index 1311e97073..668d5e359b 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/CommentIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/CommentIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class CommentIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/CustomIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/CustomIT.java index 97967d362d..6f26bc00a0 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/CustomIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/CustomIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class CustomIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/DataIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/DataIT.java index 2831af164e..d7f319fbfb 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/DataIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/DataIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class DataIT { @@ -72,6 +73,25 @@ public void shouldReceiveMultipleData() throws Exception k3po.finish(); } + + @Test + @Specification({ + "${net}/valid/request", + "${net}/valid/response" }) + public void shouldReceiveValidMessage() throws Exception + { + k3po.finish(); + } + + @Test + @Specification({ + "${net}/invalid/request", + "${net}/invalid/response" }) + public void shouldNotReceiveInvalidMessage() throws Exception + { + k3po.finish(); + } + @Test @Specification({ "${net}/fragmented.10k/request", diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/EndOfLineIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/EndOfLineIT.java index a30e9c8d3d..ea566d5ad9 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/EndOfLineIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/EndOfLineIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class EndOfLineIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ErrorIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ErrorIT.java index f5938bfdfe..f802f8881b 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ErrorIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ErrorIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ErrorIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/HandshakeIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/HandshakeIT.java index 52b80f244c..f1e78265f1 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/HandshakeIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/HandshakeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class HandshakeIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/IdIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/IdIT.java index c2843a0b71..4a9fdb0e42 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/IdIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/IdIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class IdIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ReconnectIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ReconnectIT.java index ea9c2fc101..7a8ea0e2c5 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ReconnectIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/ReconnectIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ReconnectIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/RetryIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/RetryIT.java index 4eb5ad4748..fe880fb68a 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/RetryIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/RetryIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class RetryIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/TimestampIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/TimestampIT.java index 32dd69b97e..169839696d 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/TimestampIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/TimestampIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class TimestampIT { diff --git a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/TypeIT.java b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/TypeIT.java index 8eae169df7..d36f7bf404 100644 --- a/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/TypeIT.java +++ b/specs/binding-sse.spec/src/test/java/io/aklivity/zilla/specs/binding/sse/streams/network/TypeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class TypeIT { diff --git a/specs/binding-tcp.spec/pom.xml b/specs/binding-tcp.spec/pom.xml index f5234e387a..55c1fb9320 100644 --- a/specs/binding-tcp.spec/pom.xml +++ b/specs/binding-tcp.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -109,7 +107,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.authority.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.authority.yaml index e4571947cd..6190d40d5a 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.authority.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.authority.yaml @@ -22,7 +22,7 @@ bindings: kind: client options: host: "*" - port: 8080 + port: 12345 routes: - when: - authority: local* diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml index 773339141c..42c0cd6156 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml @@ -24,11 +24,12 @@ telemetry: events: - qname: test.app0 id: binding.tcp.dns.failed - message: DNS_FAILED localhost + name: BINDING_TCP_DNS_FAILED + message: Unable to resolve host dns for address (localhost). bindings: app0: type: tcp kind: client options: host: localhost - port: 8080 + port: 12345 diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.host.and.subnet.ipv6.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.host.and.subnet.ipv6.yaml index da95d35c26..4e6a0bf47c 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.host.and.subnet.ipv6.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.host.and.subnet.ipv6.yaml @@ -22,7 +22,7 @@ bindings: kind: client options: host: google.com - port: 8080 + port: 12345 routes: - when: - cidr: ::1/64 diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.host.and.subnet.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.host.and.subnet.yaml index 78b56cac2f..73cfbbfb76 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.host.and.subnet.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.host.and.subnet.yaml @@ -22,7 +22,7 @@ bindings: kind: client options: host: google.com - port: 8080 + port: 12345 routes: - when: - cidr: 127.0.0.1/24 diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.host.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.host.yaml index 6ca3b69605..885d56c52a 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.host.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.host.yaml @@ -22,4 +22,4 @@ bindings: kind: client options: host: localhost - port: 8080 + port: 12345 diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.ip.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.ip.yaml index 827f533ece..7026545aed 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.ip.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.ip.yaml @@ -22,4 +22,4 @@ bindings: kind: client options: host: 127.0.0.1 - port: 8080 + port: 12345 diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.ipv6.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.ipv6.yaml index 3d4bc88437..46cdb987d5 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.ipv6.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.ipv6.yaml @@ -22,4 +22,4 @@ bindings: kind: client options: host: ::1 - port: 8080 + port: 12345 diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.ports.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.ports.yaml index 1fd4eb09ae..d7d0656893 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.ports.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.ports.yaml @@ -23,11 +23,11 @@ bindings: options: host: localhost port: - - 8080 - - 8081 - - 8082-8083 + - 12345 + - 12346 + - 12347-12348 routes: - when: - port: - - 8080 - - 8081-8082 + - 12345 + - 12346-12347 diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.subnet.ipv6.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.subnet.ipv6.yaml index 483f7d521b..6f7cbe65e6 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.subnet.ipv6.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.subnet.ipv6.yaml @@ -22,7 +22,7 @@ bindings: kind: client options: host: "*" - port: 8080 + port: 12345 routes: - when: - cidr: ::1/64 diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.subnet.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.subnet.yaml index bbd9c43e4f..b877e6a61d 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.subnet.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.subnet.yaml @@ -22,7 +22,7 @@ bindings: kind: client options: host: "*" - port: 8080 + port: 12345 routes: - when: - cidr: 127.0.0.1/24 diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.yaml index 6ca3b69605..885d56c52a 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.yaml @@ -22,4 +22,4 @@ bindings: kind: client options: host: localhost - port: 8080 + port: 12345 diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/server.ipv6.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/server.ipv6.yaml index a36f60cc45..5693d59455 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/server.ipv6.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/server.ipv6.yaml @@ -22,5 +22,5 @@ bindings: kind: server options: host: ::0 - port: 8080 + port: 12345 exit: app0 diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/server.ports.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/server.ports.yaml index c795e25c8f..12cfc5febd 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/server.ports.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/server.ports.yaml @@ -23,12 +23,12 @@ bindings: options: host: 0.0.0.0 port: - - 8080 - - 8081 - - 8082-8083 + - 12345 + - 12346 + - 12347-12348 routes: - when: - port: - - 8080 - - 8081-8082 + - 12345 + - 12346-12347 exit: app0 diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/server.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/server.yaml index b17410db05..ac76baba84 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/server.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/server.yaml @@ -22,5 +22,5 @@ bindings: kind: server options: host: 0.0.0.0 - port: 8080 + port: 12345 exit: app0 diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established.ipv6/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established.ipv6/client.rpt index 473c60d090..900f2b4ac1 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established.ipv6/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established.ipv6/client.rpt @@ -25,7 +25,7 @@ write zilla:begin.ext ${proxy:beginEx() .source("::1") .destination("::1") .sourcePort(32768) - .destinationPort(8080) + .destinationPort(12345) .build() .build()} diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established.ipv6/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established.ipv6/server.rpt index 1b187934c4..fb2ad3cd76 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established.ipv6/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established.ipv6/server.rpt @@ -26,7 +26,7 @@ read zilla:begin.ext ${proxy:matchBeginEx() .addressInet6() .protocol("stream") .destination("::1") - .destinationPort(8080) + .destinationPort(12345) .build() .build()} diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established/client.rpt index 3b1de381c6..052ec0db71 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established/client.rpt @@ -25,7 +25,7 @@ write zilla:begin.ext ${proxy:beginEx() .source("127.0.0.1") .destination("127.0.0.1") .sourcePort(32768) - .destinationPort(8080) + .destinationPort(12345) .build() .build()} diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established/server.rpt index d3b70005b0..c373304779 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/rfc793/connection.established/server.rpt @@ -26,7 +26,7 @@ read zilla:begin.ext ${proxy:matchBeginEx() .addressInet4() .protocol("stream") .destination("127.0.0.1") - .destinationPort(8080) + .destinationPort(12345) .build() .build()} diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.host.extension/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.host.extension/client.rpt index e2ad650624..846740a97e 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.host.extension/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.host.extension/client.rpt @@ -27,7 +27,7 @@ write zilla:begin.ext ${proxy:beginEx() .source("0.0.0.0") .destination(host) .sourcePort(0) - .destinationPort(8080) + .destinationPort(12345) .build() .build()} diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.host.extension/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.host.extension/server.rpt index 3e7f02881a..6e1229136f 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.host.extension/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.host.extension/server.rpt @@ -29,7 +29,7 @@ read zilla:begin.ext ${proxy:matchBeginEx() .source("0.0.0.0") .destination(host) .sourcePort(0) - .destinationPort(8080) + .destinationPort(12345) .build() .build()} diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv4.extension/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv4.extension/client.rpt index 2be6497fde..3523100740 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv4.extension/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv4.extension/client.rpt @@ -27,7 +27,7 @@ write zilla:begin.ext ${proxy:beginEx() .source("0.0.0.0") .destination(ip) .sourcePort(0) - .destinationPort(8080) + .destinationPort(12345) .build() .info() .authority("localhost") diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv4.extension/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv4.extension/server.rpt index 493e31804c..d58aa5cdc5 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv4.extension/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv4.extension/server.rpt @@ -29,7 +29,7 @@ read zilla:begin.ext ${proxy:matchBeginEx() .source("0.0.0.0") .destination(ip) .sourcePort(0) - .destinationPort(8080) + .destinationPort(12345) .build() .info() .authority("localhost") diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv6.extension/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv6.extension/client.rpt index d83550fbc2..5f5331c52c 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv6.extension/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv6.extension/client.rpt @@ -27,7 +27,7 @@ write zilla:begin.ext ${proxy:beginEx() .source("0.0.0.0") .destination(ip) .sourcePort(0) - .destinationPort(8080) + .destinationPort(12345) .build() .build()} diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv6.extension/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv6.extension/server.rpt index acaaca907f..9933ee9892 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv6.extension/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.ipv6.extension/server.rpt @@ -29,7 +29,7 @@ read zilla:begin.ext ${proxy:matchBeginEx() .source("0.0.0.0") .destination(ip) .sourcePort(0) - .destinationPort(8080) + .destinationPort(12345) .build() .build()} diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.port.extension/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.port.extension/client.rpt index b45ffa5fd7..6ed3523053 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.port.extension/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.port.extension/client.rpt @@ -25,7 +25,7 @@ write zilla:begin.ext ${proxy:beginEx() .source("0.0.0.0") .destination("localhost") .sourcePort(0) - .destinationPort(8082) + .destinationPort(12347) .build() .build()} diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.port.extension/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.port.extension/server.rpt index 18c87e7902..5dfa3c81d0 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.port.extension/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.connect.with.port.extension/server.rpt @@ -27,7 +27,7 @@ read zilla:begin.ext ${proxy:matchBeginEx() .source("0.0.0.0") .destination("localhost") .sourcePort(0) - .destinationPort(8082) + .destinationPort(12347) .build() .build()} diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.reset.with.no.subnet.match/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.reset.with.no.subnet.match/client.rpt index 2290564d94..b877adb151 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.reset.with.no.subnet.match/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/application/routing/client.reset.with.no.subnet.match/client.rpt @@ -26,7 +26,7 @@ write zilla:begin.ext ${proxy:beginEx() .source("0.0.0.0") .destination(ip) .sourcePort(0) - .destinationPort(8080) + .destinationPort(12345) .build() .build()} diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.multiple.frames/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.multiple.frames/client.rpt index c5120e9aa8..003e611824 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.multiple.frames/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.multiple.frames/client.rpt @@ -14,7 +14,7 @@ # under the License. # -connect "tcp://localhost:8080" +connect "tcp://localhost:12345" connected write "client data 1" diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.multiple.frames/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.multiple.frames/server.rpt index d6957085d0..d133b37901 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.multiple.frames/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.multiple.frames/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://localhost:8080" +accept "tcp://localhost:12345" notify ROUTED_SERVER accepted connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.with.padding/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.with.padding/client.rpt index c5120e9aa8..003e611824 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.with.padding/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.with.padding/client.rpt @@ -14,7 +14,7 @@ # under the License. # -connect "tcp://localhost:8080" +connect "tcp://localhost:12345" connected write "client data 1" diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.with.padding/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.with.padding/server.rpt index d6957085d0..d133b37901 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.with.padding/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.and.server.sent.data.with.padding/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://localhost:8080" +accept "tcp://localhost:12345" notify ROUTED_SERVER accepted connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.close/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.close/client.rpt index 7365adfec8..0275f84012 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.close/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.close/client.rpt @@ -14,7 +14,7 @@ # under the License. # -connect "tcp://localhost:8080" +connect "tcp://localhost:12345" connected write await CLOSEABLE diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.close/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.close/server.rpt index a1b5a6a461..a0fc2d2d49 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.close/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.close/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://localhost:8080" +accept "tcp://localhost:12345" notify ROUTED_SERVER accepted diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.frames/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.frames/client.rpt index da38a83ef8..00998d9987 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.frames/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.frames/client.rpt @@ -14,7 +14,7 @@ # under the License. # -connect "tcp://localhost:8080" +connect "tcp://localhost:12345" connected write "client data 1" diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.frames/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.frames/server.rpt index 44dffd10c7..38d9b348bc 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.frames/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.frames/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://localhost:8080" +accept "tcp://localhost:12345" notify ROUTED_SERVER accepted connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.streams/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.streams/client.rpt index e4f79cde9c..cc0db02612 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.streams/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.streams/client.rpt @@ -14,7 +14,7 @@ # under the License. # -connect "tcp://localhost:8080" +connect "tcp://localhost:12345" connected write notify CLIENT_CONNECTION_ONE_ESTABLISHED @@ -22,7 +22,7 @@ write notify CLIENT_CONNECTION_ONE_ESTABLISHED write "client data 1" connect await CLIENT_CONNECTION_ONE_ESTABLISHED - "tcp://localhost:8080" + "tcp://localhost:12345" connected write "client data 2" diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.streams/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.streams/server.rpt index afe0f9e511..aa9efd2e27 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.streams/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data.multiple.streams/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://localhost:8080" +accept "tcp://localhost:12345" notify ROUTED_SERVER accepted connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data/client.rpt index c8af423e60..93215754af 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data/client.rpt @@ -14,6 +14,6 @@ # under the License. # -connect "tcp://localhost:8080" +connect "tcp://localhost:12345" connected write "client data" diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data/server.rpt index fcc8bdf2f1..bfa576fe60 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/client.sent.data/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://localhost:8080" +accept "tcp://localhost:12345" notify ROUTED_SERVER accepted connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/concurrent.connections/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/concurrent.connections/client.rpt index 7b52a721bd..cb349208ba 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/concurrent.connections/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/concurrent.connections/client.rpt @@ -15,7 +15,7 @@ # # Stream 1 -connect "tcp://localhost:8080" +connect "tcp://localhost:12345" connected write "Hello" read "Hello" @@ -25,7 +25,7 @@ close closed # Stream 2 -connect "tcp://localhost:8080" +connect "tcp://localhost:12345" connected write "Hello" read "Hello" @@ -35,7 +35,7 @@ close closed # Stream 3 -connect "tcp://localhost:8080" +connect "tcp://localhost:12345" connected write "Hello" read "Hello" diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/concurrent.connections/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/concurrent.connections/server.rpt index c3f87ec158..92420efe5c 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/concurrent.connections/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/concurrent.connections/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://localhost:8080" +accept "tcp://localhost:12345" notify ROUTED_SERVER # Stream 1 diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/connection.established/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/connection.established/client.rpt index 92d4f5f38e..88070b4aa1 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/connection.established/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/connection.established/client.rpt @@ -14,7 +14,7 @@ # under the License. # -property address "tcp://localhost:8080" +property address "tcp://localhost:12345" connect ${address} connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/connection.established/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/connection.established/server.rpt index 658c7792b1..a7d280d57e 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/connection.established/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/connection.established/server.rpt @@ -14,7 +14,7 @@ # under the License. # -property address "tcp://localhost:8080" +property address "tcp://localhost:12345" accept ${address} notify ROUTED_SERVER diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.close/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.close/client.rpt index 877026a14d..614bb0bd86 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.close/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.close/client.rpt @@ -14,7 +14,7 @@ # under the License. # -connect "tcp://localhost:8080" +connect "tcp://localhost:12345" connected read notify CLOSEABLE diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.close/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.close/server.rpt index cd4ffa8d1d..01ebb8d945 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.close/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.close/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://localhost:8080" +accept "tcp://localhost:12345" notify ROUTED_SERVER accepted diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.frames/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.frames/client.rpt index cb9fd5e6e4..66e4b0e825 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.frames/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.frames/client.rpt @@ -14,7 +14,7 @@ # under the License. # -connect "tcp://localhost:8080" +connect "tcp://localhost:12345" connected read "server data 1" diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.frames/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.frames/server.rpt index 7c56b8145e..2e4f3a08f5 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.frames/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.frames/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://localhost:8080" +accept "tcp://localhost:12345" notify ROUTED_SERVER accepted connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.streams/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.streams/client.rpt index a206e1233a..26cedc1914 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.streams/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.streams/client.rpt @@ -14,14 +14,14 @@ # under the License. # -connect "tcp://localhost:8080" +connect "tcp://localhost:12345" connected write notify CLIENT_CONNECTION_ONE_ESTABLISHED read "server data 1" connect await CLIENT_CONNECTION_ONE_ESTABLISHED - "tcp://localhost:8080" + "tcp://localhost:12345" connected read "server data 2" diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.streams/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.streams/server.rpt index 368eb533b6..fde6fc943a 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.streams/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data.multiple.streams/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://localhost:8080" +accept "tcp://localhost:12345" notify ROUTED_SERVER accepted connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data/client.rpt index af98bca7ad..553ccb1f78 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data/client.rpt @@ -14,6 +14,6 @@ # under the License. # -connect "tcp://localhost:8080" +connect "tcp://localhost:12345" connected read "server data" diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data/server.rpt index 11fba73dfa..f28cd7a85d 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/rfc793/server.sent.data/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://localhost:8080" +accept "tcp://localhost:12345" notify ROUTED_SERVER accepted connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.host.extension/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.host.extension/client.rpt index b88c5490ec..dd85b590c7 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.host.extension/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.host.extension/client.rpt @@ -14,5 +14,5 @@ # under the License. # -connect "tcp://localhost:8080" +connect "tcp://localhost:12345" connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.host.extension/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.host.extension/server.rpt index 52727d18dd..bf9737265a 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.host.extension/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.host.extension/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://localhost:8080" +accept "tcp://localhost:12345" notify ROUTED_SERVER accepted connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv4.extension/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv4.extension/client.rpt index 18736ebb2a..08b7d66869 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv4.extension/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv4.extension/client.rpt @@ -14,5 +14,5 @@ # under the License. # -connect "tcp://127.0.0.1:8080" +connect "tcp://127.0.0.1:12345" connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv4.extension/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv4.extension/server.rpt index 19cc208b63..64cff12f5b 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv4.extension/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv4.extension/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://127.0.0.1:8080" +accept "tcp://127.0.0.1:12345" notify ROUTED_SERVER accepted connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv6.extension/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv6.extension/client.rpt index 1a6ab327c3..6ec6cdc1e0 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv6.extension/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv6.extension/client.rpt @@ -14,5 +14,5 @@ # under the License. # -connect "tcp://[::1]:8080" +connect "tcp://[::1]:12345" connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv6.extension/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv6.extension/server.rpt index 2125e191d2..7a6b562b30 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv6.extension/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.ipv6.extension/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://[::1]:8080" +accept "tcp://[::1]:12345" notify ROUTED_SERVER accepted connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.port.extension/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.port.extension/client.rpt index 6716a6a724..971bf2a500 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.port.extension/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.port.extension/client.rpt @@ -14,5 +14,5 @@ # under the License. # -connect "tcp://localhost:8082" +connect "tcp://localhost:12347" connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.port.extension/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.port.extension/server.rpt index 963bb11024..8df089350e 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.port.extension/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/client.connect.with.port.extension/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://localhost:8082" +accept "tcp://localhost:12347" accepted connected diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/server.close.port.not.routed/client.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/server.close.port.not.routed/client.rpt index 87a1b0b8f8..256ff67562 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/server.close.port.not.routed/client.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/server.close.port.not.routed/client.rpt @@ -14,7 +14,7 @@ # under the License. # -connect "tcp://localhost:8083" +connect "tcp://localhost:12348" connected closed diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/server.close.port.not.routed/server.rpt b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/server.close.port.not.routed/server.rpt index ef262a77bb..a47dfe763b 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/server.close.port.not.routed/server.rpt +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/streams/network/routing/server.close.port.not.routed/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "tcp://localhost:8083" +accept "tcp://localhost:12348" notify ROUTED_SERVER accepted diff --git a/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/ApplicationIT.java b/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/ApplicationIT.java index bb026b47b1..2b88c7595b 100644 --- a/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/ApplicationIT.java +++ b/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/ApplicationIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-793 diff --git a/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/ApplicationRoutingIT.java b/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/ApplicationRoutingIT.java index 11eae5a6f4..8a4789fbbd 100644 --- a/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/ApplicationRoutingIT.java +++ b/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/ApplicationRoutingIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ApplicationRoutingIT { diff --git a/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/NetworkIT.java b/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/NetworkIT.java index 750e2f07a3..0dcc843449 100644 --- a/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/NetworkIT.java +++ b/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/NetworkIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-793 diff --git a/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/NetworkRoutingIT.java b/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/NetworkRoutingIT.java index 3859a64dd9..78a81b8ceb 100644 --- a/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/NetworkRoutingIT.java +++ b/specs/binding-tcp.spec/src/test/java/io/aklivity/zilla/specs/binding/tcp/streams/NetworkRoutingIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class NetworkRoutingIT { diff --git a/specs/binding-tls.spec/pom.xml b/specs/binding-tls.spec/pom.xml index 8240ad63c8..0c17cb2a79 100644 --- a/specs/binding-tls.spec/pom.xml +++ b/specs/binding-tls.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -52,8 +50,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -123,7 +121,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-tls.spec/src/main/java/io/aklivity/zilla/specs/binding/tls/internal/TlsFunctions.java b/specs/binding-tls.spec/src/main/java/io/aklivity/zilla/specs/binding/tls/internal/TlsFunctions.java index 4df305c905..cd5db75ed6 100644 --- a/specs/binding-tls.spec/src/main/java/io/aklivity/zilla/specs/binding/tls/internal/TlsFunctions.java +++ b/specs/binding-tls.spec/src/main/java/io/aklivity/zilla/specs/binding/tls/internal/TlsFunctions.java @@ -18,8 +18,8 @@ import java.util.Random; import java.util.concurrent.ThreadLocalRandom; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; public final class TlsFunctions { diff --git a/specs/binding-tls.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/binding-tls.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/binding-tls.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/binding-tls.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml index 0a9021abdb..3476b91ec5 100644 --- a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml +++ b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.app0 id: binding.tls.handshake.failed - message: HANDSHAKE_FAILED + name: BINDING_TLS_HANDSHAKE_FAILED + message: The client and server could not negotiate the desired level of security. vaults: client: type: filesystem diff --git a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml index 97d01e2526..8898502229 100644 --- a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml +++ b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.tls.handshake.failed - message: HANDSHAKE_FAILED + name: BINDING_TLS_HANDSHAKE_FAILED + message: The client and server could not negotiate the desired level of security. vaults: server: type: filesystem diff --git a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml index f9a4e5a794..7b8ea44799 100644 --- a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml +++ b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.tls.tls.failed - message: TLS_FAILED + name: BINDING_TLS_TLS_FAILED + message: There was a generic error detected by an SSL subsystem. vaults: server: type: filesystem diff --git a/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/internal/TlsFunctionsTest.java b/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/internal/TlsFunctionsTest.java index c26c24f83b..1a72a00ff3 100644 --- a/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/internal/TlsFunctionsTest.java +++ b/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/internal/TlsFunctionsTest.java @@ -15,7 +15,7 @@ */ package io.aklivity.zilla.specs.binding.tls.internal; -import static org.kaazing.k3po.lang.internal.el.ExpressionFactoryUtils.newExpressionFactory; +import static io.aklivity.k3po.runtime.lang.internal.el.ExpressionFactoryUtils.newExpressionFactory; import javax.el.ELContext; import javax.el.ExpressionFactory; @@ -23,7 +23,8 @@ import org.junit.Before; import org.junit.Test; -import org.kaazing.k3po.lang.internal.el.ExpressionContext; + +import io.aklivity.k3po.runtime.lang.internal.el.ExpressionContext; public class TlsFunctionsTest { diff --git a/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/ApplicationIT.java b/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/ApplicationIT.java index cce2e9b767..ac5a686b97 100644 --- a/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/ApplicationIT.java +++ b/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/ApplicationIT.java @@ -23,9 +23,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ApplicationIT { diff --git a/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/BridgeIT.java b/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/BridgeIT.java index 70c654fb78..b36bbc8c77 100644 --- a/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/BridgeIT.java +++ b/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/BridgeIT.java @@ -23,9 +23,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class BridgeIT { diff --git a/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/NetworkIT.java b/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/NetworkIT.java index 3d5b10b8bf..7aa46c2ed5 100644 --- a/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/NetworkIT.java +++ b/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/NetworkIT.java @@ -24,9 +24,10 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.ScriptProperty; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.ScriptProperty; +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class NetworkIT { diff --git a/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/ProxyIT.java b/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/ProxyIT.java index 9dc3a337a8..c1c905e2f5 100644 --- a/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/ProxyIT.java +++ b/specs/binding-tls.spec/src/test/java/io/aklivity/zilla/specs/binding/tls/stream/ProxyIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ProxyIT { diff --git a/specs/binding-ws.spec/pom.xml b/specs/binding-ws.spec/pom.xml index 09a94841d9..6ec546d1ef 100644 --- a/specs/binding-ws.spec/pom.xml +++ b/specs/binding-ws.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -110,7 +108,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/binding-ws.spec/src/main/java/io/aklivity/zilla/specs/binding/ws/internal/WsFunctions.java b/specs/binding-ws.spec/src/main/java/io/aklivity/zilla/specs/binding/ws/internal/WsFunctions.java index 8f0d546f16..53910df5ba 100644 --- a/specs/binding-ws.spec/src/main/java/io/aklivity/zilla/specs/binding/ws/internal/WsFunctions.java +++ b/specs/binding-ws.spec/src/main/java/io/aklivity/zilla/specs/binding/ws/internal/WsFunctions.java @@ -25,9 +25,9 @@ import org.agrona.MutableDirectBuffer; import org.agrona.concurrent.UnsafeBuffer; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.specs.binding.ws.internal.types.stream.WsBeginExFW; public final class WsFunctions diff --git a/specs/binding-ws.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/binding-ws.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/binding-ws.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/binding-ws.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/internal/WsFunctionsTest.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/internal/WsFunctionsTest.java index be77c4a7e5..99cb0fdd7e 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/internal/WsFunctionsTest.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/internal/WsFunctionsTest.java @@ -15,12 +15,12 @@ */ package io.aklivity.zilla.specs.binding.ws.internal; +import static io.aklivity.k3po.runtime.lang.internal.el.ExpressionFactoryUtils.newExpressionFactory; import static io.aklivity.zilla.specs.binding.ws.internal.WsFunctions.beginEx; import static io.aklivity.zilla.specs.binding.ws.internal.WsFunctions.handshakeHash; import static io.aklivity.zilla.specs.binding.ws.internal.WsFunctions.handshakeKey; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import static org.kaazing.k3po.lang.internal.el.ExpressionFactoryUtils.newExpressionFactory; import javax.el.ELContext; import javax.el.ExpressionFactory; @@ -30,8 +30,8 @@ import org.agrona.concurrent.UnsafeBuffer; import org.junit.Before; import org.junit.Test; -import org.kaazing.k3po.lang.internal.el.ExpressionContext; +import io.aklivity.k3po.runtime.lang.internal.el.ExpressionContext; import io.aklivity.zilla.specs.binding.ws.internal.WsFunctions.WsBeginExHelper; import io.aklivity.zilla.specs.binding.ws.internal.types.stream.WsBeginExFW; diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/AdvisoryIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/AdvisoryIT.java index 446b61301d..10f8bdf68e 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/AdvisoryIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/AdvisoryIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AdvisoryIT { diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/BaseFramingIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/BaseFramingIT.java index adcef02b8b..745b6cedf4 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/BaseFramingIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/BaseFramingIT.java @@ -24,8 +24,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-6455, section 5.2 "Base Framing Protocol" diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/ClosingHandshakeIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/ClosingHandshakeIT.java index 5dcd295836..710dde855b 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/ClosingHandshakeIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/ClosingHandshakeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ClosingHandshakeIT { diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/ControlIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/ControlIT.java index 570a9d703f..f6c398f222 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/ControlIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/ControlIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-6455, section 4.1 "Client-Side Requirements" RFC-6455, section 4.2 diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/FlowControlIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/FlowControlIT.java index 4f89d6076d..939b9bb0fe 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/FlowControlIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/FlowControlIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class FlowControlIT { diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/FragmentationIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/FragmentationIT.java index c9f6eab519..e0f40f63ec 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/FragmentationIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/FragmentationIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-6455, section 5.2 "Base Framing Protocol" diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/OpeningHandshakeIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/OpeningHandshakeIT.java index ebe92b3c00..325382f5a3 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/OpeningHandshakeIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/application/OpeningHandshakeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-6455, section 4.1 "Client-Side Requirements" RFC-6455, section 4.2 diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/AdvisoryIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/AdvisoryIT.java index 7f189524fa..ed33b3dce5 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/AdvisoryIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/AdvisoryIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class AdvisoryIT { diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/BaseFramingIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/BaseFramingIT.java index 6757d8d333..51b2c2c9c6 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/BaseFramingIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/BaseFramingIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-6455, section 5.2 "Base Framing Protocol" diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/ClosingHandshakeIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/ClosingHandshakeIT.java index 7eb933c71d..1cadbc4240 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/ClosingHandshakeIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/ClosingHandshakeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-6455, section 7 "Closing the Connection" diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/ControlIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/ControlIT.java index ea8b5909f1..d73e4ac076 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/ControlIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/ControlIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-6455, section 5.5 "Control Frames" diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/DataFramingIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/DataFramingIT.java index 697d144e66..0938310113 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/DataFramingIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/DataFramingIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-6455, section 5.6 "Data Frames" diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/ExtensibilityIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/ExtensibilityIT.java index e9663e0e33..0b71d4e54b 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/ExtensibilityIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/ExtensibilityIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-6455, section 5.8 "Extensibility" diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/FlowControlIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/FlowControlIT.java index c54938553e..416e063f21 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/FlowControlIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/FlowControlIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-6455, section 5.2 "Base Framing Protocol" diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/FragmentationIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/FragmentationIT.java index c017bf983b..373700974c 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/FragmentationIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/FragmentationIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-6455, section 5.4 "Fragmentation" diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/MaskingIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/MaskingIT.java index 9be9eaba58..559a87cf8f 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/MaskingIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/MaskingIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-6455 section 5.1 "Overview" section 5.3 "Client-to-Server Masking" diff --git a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/OpeningHandshakeIT.java b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/OpeningHandshakeIT.java index 5fe805abf7..43c61dbc94 100644 --- a/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/OpeningHandshakeIT.java +++ b/specs/binding-ws.spec/src/test/java/io/aklivity/zilla/specs/binding/ws/streams/network/OpeningHandshakeIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; /** * RFC-6455, section 4.1 "Client-Side Requirements" diff --git a/specs/catalog-apicurio.spec/NOTICE b/specs/catalog-apicurio.spec/NOTICE index ed4c502c75..fa9b8adebc 100644 --- a/specs/catalog-apicurio.spec/NOTICE +++ b/specs/catalog-apicurio.spec/NOTICE @@ -16,8 +16,7 @@ This project includes: Jakarta JSON Processing API under Eclipse Public License 2.0 or GNU General Public License, version 2 with the GNU Classpath Exception Java Unified Expression Language API under The Apache Software License, Version 2.0 Java Unified Expression Language Implementation under The Apache Software License, Version 2.0 - k3po/lang under The Apache Software License, Version 2.0 - Kaazing Corporation License under The Apache Software License, Version 2.0 + k3po::runtime::lang under The Apache Software License, Version 2.0 org.leadpony.justify under The Apache Software License, Version 2.0 zilla::specs::engine.spec under The Apache Software License, Version 2.0 diff --git a/specs/catalog-apicurio.spec/pom.xml b/specs/catalog-apicurio.spec/pom.xml index 1d7ba4964e..198657a60c 100644 --- a/specs/catalog-apicurio.spec/pom.xml +++ b/specs/catalog-apicurio.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.98 0 diff --git a/specs/catalog-apicurio.spec/src/main/resources/META-INF/zilla/apicurio.idl b/specs/catalog-apicurio.spec/src/main/resources/META-INF/zilla/apicurio.idl index 2e19e88727..ca87587f99 100644 --- a/specs/catalog-apicurio.spec/src/main/resources/META-INF/zilla/apicurio.idl +++ b/specs/catalog-apicurio.spec/src/main/resources/META-INF/zilla/apicurio.idl @@ -43,13 +43,13 @@ scope apicurio int32 artifactId; } - struct ApicurioRetrievableArtifactSubjectVersionEx extends core::stream::Extension + struct ApicurioRetrievedArtifactSubjectVersionEx extends core::stream::Extension { string8 subject; string8 version; } - struct ApicurioRetrievableArtifactIdEx extends core::stream::Extension + struct ApicurioRetrievedArtifactIdEx extends core::stream::Extension { int32 artifactId; } @@ -59,8 +59,8 @@ scope apicurio case UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION: ApicurioUnretrievableArtifactSubjectVersionEx unretrievableArtifactSubjectVersion; case UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT: ApicurioUnretrievableArtifactSubjectVersionStaleArtifactEx unretrievableArtifactSubjectVersionStaleArtifact; case UNRETRIEVABLE_ARTIFACT_ID: ApicurioUnretrievableArtifactIdEx unretrievableArtifactId; - case RETRIEVED_ARTIFACT_SUBJECT_VERSION: ApicurioRetrievableArtifactSubjectVersionEx retrievableArtifactSubjectVersion; - case RETRIEVED_ARTIFACT_ID: ApicurioRetrievableArtifactIdEx retrievableArtifactId; + case RETRIEVED_ARTIFACT_SUBJECT_VERSION: ApicurioRetrievedArtifactSubjectVersionEx retrievedArtifactSubjectVersion; + case RETRIEVED_ARTIFACT_ID: ApicurioRetrievedArtifactIdEx retrievedArtifactId; } } } diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml index b4983ae5ab..b4eaf2d073 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml @@ -23,10 +23,12 @@ telemetry: events: - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.id - message: UNRETRIEVABLE_ARTIFACT_ID 1 + name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_ID + message: Unable to fetch artifact id 1. - qname: test.catalog0 - id: catalog.apicurio.retrievable.artifact.id - message: RETRIEVED_ARTIFACT_ID 1 + id: catalog.apicurio.retrieved.artifact.id + name: CATALOG_APICURIO_RETRIEVED_ARTIFACT_ID + message: Successfully fetched artifact id 1. catalogs: catalog0: type: apicurio diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml index 2c391e7ae5..ef7ad346df 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.subject.version - message: UNRETRIEVABLE_ARTIFACT artifactId latest + name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION + message: Unable to fetch artifact for subject artifactId with version latest. catalogs: catalog0: type: apicurio diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml index a47879431e..ca4cad8fae 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml @@ -23,13 +23,16 @@ telemetry: events: - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.subject.version - message: UNRETRIEVABLE_ARTIFACT artifactId latest + name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION + message: Unable to fetch artifact for subject artifactId with version latest. - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.subject.version.stale.artifact - message: UNRETRIEVABLE_ARTIFACT artifactId latest, USING_STALE_ARTIFACT 1 + name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT + message: Unable to fetch artifact for subject artifactId with version latest; using stale artifact with id 1. - qname: test.catalog0 - id: catalog.apicurio.retrievable.artifact.subject.version - message: RETRIEVED_ARTIFACT_SUBJECT_VERSION artifactId latest + id: catalog.apicurio.retrieved.artifact.subject.version + name: CATALOG_APICURIO_RETRIEVED_ARTIFACT_SUBJECT_VERSION + message: Successfully fetched artifact for subject artifactId with version latest. catalogs: catalog0: type: apicurio diff --git a/specs/catalog-filesystem.spec/COPYRIGHT b/specs/catalog-filesystem.spec/COPYRIGHT new file mode 100644 index 0000000000..0cb10b6f62 --- /dev/null +++ b/specs/catalog-filesystem.spec/COPYRIGHT @@ -0,0 +1,12 @@ +Copyright ${copyrightYears} Aklivity Inc + +Licensed under the Aklivity Community License (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at + + https://www.aklivity.io/aklivity-community-license/ + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +WARRANTIES OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. diff --git a/specs/catalog-filesystem.spec/LICENSE b/specs/catalog-filesystem.spec/LICENSE new file mode 100644 index 0000000000..f6abb6327b --- /dev/null +++ b/specs/catalog-filesystem.spec/LICENSE @@ -0,0 +1,114 @@ + Aklivity Community License Agreement + Version 1.0 + +This Aklivity Community License Agreement Version 1.0 (the “Agreement”) sets +forth the terms on which Aklivity, Inc. (“Aklivity”) makes available certain +software made available by Aklivity under this Agreement (the “Software”). BY +INSTALLING, DOWNLOADING, ACCESSING, USING OR DISTRIBUTING ANY OF THE SOFTWARE, +YOU AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO +SUCH TERMS AND CONDITIONS, YOU MUST NOT USE THE SOFTWARE. IF YOU ARE RECEIVING +THE SOFTWARE ON BEHALF OF A LEGAL ENTITY, YOU REPRESENT AND WARRANT THAT YOU +HAVE THE ACTUAL AUTHORITY TO AGREE TO THE TERMS AND CONDITIONS OF THIS +AGREEMENT ON BEHALF OF SUCH ENTITY. “Licensee” means you, an individual, or +the entity on whose behalf you are receiving the Software. + + 1. LICENSE GRANT AND CONDITIONS. + + 1.1 License. Subject to the terms and conditions of this Agreement, + Aklivity hereby grants to Licensee a non-exclusive, royalty-free, + worldwide, non-transferable, non-sublicenseable license during the term + of this Agreement to: (a) use the Software; (b) prepare modifications and + derivative works of the Software; (c) distribute the Software (including + without limitation in source code or object code form); and (d) reproduce + copies of the Software (the “License”). Licensee is not granted the + right to, and Licensee shall not, exercise the License for an Excluded + Purpose. For purposes of this Agreement, “Excluded Purpose” means making + available any software-as-a-service, platform-as-a-service, + infrastructure-as-a-service or other similar online service that competes + with Aklivity products or services that provide the Software. + + 1.2 Conditions. In consideration of the License, Licensee’s distribution + of the Software is subject to the following conditions: + + (a) Licensee must cause any Software modified by Licensee to carry + prominent notices stating that Licensee modified the Software. + + (b) On each Software copy, Licensee shall reproduce and not remove or + alter all Aklivity or third party copyright or other proprietary + notices contained in the Software, and Licensee must provide the + notice below with each copy. + + “This software is made available by Aklivity, Inc., under the + terms of the Aklivity Community License Agreement, Version 1.0 + located at http://www.Aklivity.io/Aklivity-community-license. BY + INSTALLING, DOWNLOADING, ACCESSING, USING OR DISTRIBUTING ANY OF + THE SOFTWARE, YOU AGREE TO THE TERMS OF SUCH LICENSE AGREEMENT.” + + 1.3 Licensee Modifications. Licensee may add its own copyright notices + to modifications made by Licensee and may provide additional or different + license terms and conditions for use, reproduction, or distribution of + Licensee’s modifications. While redistributing the Software or + modifications thereof, Licensee may choose to offer, for a fee or free of + charge, support, warranty, indemnity, or other obligations. Licensee, and + not Aklivity, will be responsible for any such obligations. + + 1.4 No Sublicensing. The License does not include the right to + sublicense the Software, however, each recipient to which Licensee + provides the Software may exercise the Licenses so long as such recipient + agrees to the terms and conditions of this Agreement. + + 2. TERM AND TERMINATION. This Agreement will continue unless and until + earlier terminated as set forth herein. If Licensee breaches any of its + conditions or obligations under this Agreement, this Agreement will + terminate automatically and the License will terminate automatically and + permanently. + + 3. INTELLECTUAL PROPERTY. As between the parties, Aklivity will retain all + right, title, and interest in the Software, and all intellectual property + rights therein. Aklivity hereby reserves all rights not expressly granted + to Licensee in this Agreement. Aklivity hereby reserves all rights in its + trademarks and service marks, and no licenses therein are granted in this + Agreement. + + 4. DISCLAIMER. Aklivity HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND + CONDITIONS, EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, AND SPECIFICALLY + DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR + PURPOSE, WITH RESPECT TO THE SOFTWARE. + + 5. LIMITATION OF LIABILITY. Aklivity WILL NOT BE LIABLE FOR ANY DAMAGES OF + ANY KIND, INCLUDING BUT NOT LIMITED TO, LOST PROFITS OR ANY CONSEQUENTIAL, + SPECIAL, INCIDENTAL, INDIRECT, OR DIRECT DAMAGES, HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, ARISING OUT OF THIS AGREEMENT. THE FOREGOING SHALL + APPLY TO THE EXTENT PERMITTED BY APPLICABLE LAW. + + 6.GENERAL. + + 6.1 Governing Law. This Agreement will be governed by and interpreted in + accordance with the laws of the state of California, without reference to + its conflict of laws principles. If Licensee is located within the + United States, all disputes arising out of this Agreement are subject to + the exclusive jurisdiction of courts located in Santa Clara County, + California. USA. If Licensee is located outside of the United States, + any dispute, controversy or claim arising out of or relating to this + Agreement will be referred to and finally determined by arbitration in + accordance with the JAMS International Arbitration Rules. The tribunal + will consist of one arbitrator. The place of arbitration will be Palo + Alto, California. The language to be used in the arbitral proceedings + will be English. Judgment upon the award rendered by the arbitrator may + be entered in any court having jurisdiction thereof. + + 6.2 Assignment. Licensee is not authorized to assign its rights under + this Agreement to any third party. Aklivity may freely assign its rights + under this Agreement to any third party. + + 6.3 Other. This Agreement is the entire agreement between the parties + regarding the subject matter hereof. No amendment or modification of + this Agreement will be valid or binding upon the parties unless made in + writing and signed by the duly authorized representatives of both + parties. In the event that any provision, including without limitation + any condition, of this Agreement is held to be unenforceable, this + Agreement and all licenses and rights granted hereunder will immediately + terminate. Waiver by Aklivity of a breach of any provision of this + Agreement or the failure by Aklivity to exercise any right hereunder + will not be construed as a waiver of any subsequent breach of that right + or as a waiver of any other right. \ No newline at end of file diff --git a/incubator/catalog-filesystem.spec/NOTICE b/specs/catalog-filesystem.spec/NOTICE similarity index 89% rename from incubator/catalog-filesystem.spec/NOTICE rename to specs/catalog-filesystem.spec/NOTICE index ed4c502c75..fa9b8adebc 100644 --- a/incubator/catalog-filesystem.spec/NOTICE +++ b/specs/catalog-filesystem.spec/NOTICE @@ -16,8 +16,7 @@ This project includes: Jakarta JSON Processing API under Eclipse Public License 2.0 or GNU General Public License, version 2 with the GNU Classpath Exception Java Unified Expression Language API under The Apache Software License, Version 2.0 Java Unified Expression Language Implementation under The Apache Software License, Version 2.0 - k3po/lang under The Apache Software License, Version 2.0 - Kaazing Corporation License under The Apache Software License, Version 2.0 + k3po::runtime::lang under The Apache Software License, Version 2.0 org.leadpony.justify under The Apache Software License, Version 2.0 zilla::specs::engine.spec under The Apache Software License, Version 2.0 diff --git a/specs/catalog-filesystem.spec/NOTICE.template b/specs/catalog-filesystem.spec/NOTICE.template new file mode 100644 index 0000000000..209ca12f74 --- /dev/null +++ b/specs/catalog-filesystem.spec/NOTICE.template @@ -0,0 +1,13 @@ +Licensed under the Aklivity Community License (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at + + https://www.aklivity.io/aklivity-community-license/ + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +WARRANTIES OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. + +This project includes: +#GENERATED_NOTICES# diff --git a/specs/catalog-filesystem.spec/mvnw b/specs/catalog-filesystem.spec/mvnw new file mode 100755 index 0000000000..d2f0ea3808 --- /dev/null +++ b/specs/catalog-filesystem.spec/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven2 Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/specs/catalog-filesystem.spec/mvnw.cmd b/specs/catalog-filesystem.spec/mvnw.cmd new file mode 100644 index 0000000000..b26ab24f03 --- /dev/null +++ b/specs/catalog-filesystem.spec/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/incubator/catalog-filesystem.spec/pom.xml b/specs/catalog-filesystem.spec/pom.xml similarity index 94% rename from incubator/catalog-filesystem.spec/pom.xml rename to specs/catalog-filesystem.spec/pom.xml index 7d1d3d3277..0263d37efe 100644 --- a/incubator/catalog-filesystem.spec/pom.xml +++ b/specs/catalog-filesystem.spec/pom.xml @@ -7,13 +7,13 @@ 4.0.0 io.aklivity.zilla - incubator - 0.9.82 + specs + 0.9.83 ../pom.xml catalog-filesystem.spec - zilla::incubator::catalog-filesystem.spec + zilla::specs::catalog-filesystem.spec @@ -24,8 +24,6 @@ - 11 - 11 0.98 0 diff --git a/incubator/catalog-filesystem.spec/src/main/moditect/module-info.java b/specs/catalog-filesystem.spec/src/main/moditect/module-info.java similarity index 100% rename from incubator/catalog-filesystem.spec/src/main/moditect/module-info.java rename to specs/catalog-filesystem.spec/src/main/moditect/module-info.java diff --git a/incubator/catalog-filesystem.spec/src/main/resources/META-INF/zilla/filesystem.idl b/specs/catalog-filesystem.spec/src/main/resources/META-INF/zilla/filesystem.idl similarity index 100% rename from incubator/catalog-filesystem.spec/src/main/resources/META-INF/zilla/filesystem.idl rename to specs/catalog-filesystem.spec/src/main/resources/META-INF/zilla/filesystem.idl diff --git a/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/asyncapi/mqtt.yaml b/specs/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/asyncapi/mqtt.yaml similarity index 100% rename from incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/asyncapi/mqtt.yaml rename to specs/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/asyncapi/mqtt.yaml diff --git a/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/catalog.yaml b/specs/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/catalog.yaml similarity index 100% rename from incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/catalog.yaml rename to specs/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/catalog.yaml diff --git a/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml b/specs/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml similarity index 87% rename from incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml rename to specs/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml index 7200e67713..ff3c57fe7f 100644 --- a/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml +++ b/specs/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.catalog0 id: catalog.filesystem.file.not.found - message: FILE_NOT_FOUND asyncapi/kafka.yaml + name: CATALOG_FILESYSTEM_FILE_NOT_FOUND + message: Unable to find file at (asyncapi/kafka.yaml) on the host filesystem. catalogs: catalog0: type: filesystem diff --git a/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/schema/filesystem.schema.patch.json b/specs/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/schema/filesystem.schema.patch.json similarity index 100% rename from incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/schema/filesystem.schema.patch.json rename to specs/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/schema/filesystem.schema.patch.json diff --git a/incubator/catalog-filesystem.spec/src/test/java/io/aklivity/zilla/specs/catalog/filesystem/config/SchemaTest.java b/specs/catalog-filesystem.spec/src/test/java/io/aklivity/zilla/specs/catalog/filesystem/config/SchemaTest.java similarity index 100% rename from incubator/catalog-filesystem.spec/src/test/java/io/aklivity/zilla/specs/catalog/filesystem/config/SchemaTest.java rename to specs/catalog-filesystem.spec/src/test/java/io/aklivity/zilla/specs/catalog/filesystem/config/SchemaTest.java diff --git a/specs/catalog-inline.spec/NOTICE b/specs/catalog-inline.spec/NOTICE index ed4c502c75..fa9b8adebc 100644 --- a/specs/catalog-inline.spec/NOTICE +++ b/specs/catalog-inline.spec/NOTICE @@ -16,8 +16,7 @@ This project includes: Jakarta JSON Processing API under Eclipse Public License 2.0 or GNU General Public License, version 2 with the GNU Classpath Exception Java Unified Expression Language API under The Apache Software License, Version 2.0 Java Unified Expression Language Implementation under The Apache Software License, Version 2.0 - k3po/lang under The Apache Software License, Version 2.0 - Kaazing Corporation License under The Apache Software License, Version 2.0 + k3po::runtime::lang under The Apache Software License, Version 2.0 org.leadpony.justify under The Apache Software License, Version 2.0 zilla::specs::engine.spec under The Apache Software License, Version 2.0 diff --git a/specs/catalog-inline.spec/pom.xml b/specs/catalog-inline.spec/pom.xml index 2e6047ac66..ecdc74eac9 100644 --- a/specs/catalog-inline.spec/pom.xml +++ b/specs/catalog-inline.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.98 0 diff --git a/specs/catalog-karapace.spec/NOTICE b/specs/catalog-karapace.spec/NOTICE index ed4c502c75..fa9b8adebc 100644 --- a/specs/catalog-karapace.spec/NOTICE +++ b/specs/catalog-karapace.spec/NOTICE @@ -16,8 +16,7 @@ This project includes: Jakarta JSON Processing API under Eclipse Public License 2.0 or GNU General Public License, version 2 with the GNU Classpath Exception Java Unified Expression Language API under The Apache Software License, Version 2.0 Java Unified Expression Language Implementation under The Apache Software License, Version 2.0 - k3po/lang under The Apache Software License, Version 2.0 - Kaazing Corporation License under The Apache Software License, Version 2.0 + k3po::runtime::lang under The Apache Software License, Version 2.0 org.leadpony.justify under The Apache Software License, Version 2.0 zilla::specs::engine.spec under The Apache Software License, Version 2.0 diff --git a/specs/catalog-karapace.spec/pom.xml b/specs/catalog-karapace.spec/pom.xml index 6491baf7eb..cc7a7b4cd8 100644 --- a/specs/catalog-karapace.spec/pom.xml +++ b/specs/catalog-karapace.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.98 0 diff --git a/specs/catalog-karapace.spec/src/main/resources/META-INF/zilla/karapace.idl b/specs/catalog-karapace.spec/src/main/resources/META-INF/zilla/karapace.idl index e277c81e52..2004aa856d 100644 --- a/specs/catalog-karapace.spec/src/main/resources/META-INF/zilla/karapace.idl +++ b/specs/catalog-karapace.spec/src/main/resources/META-INF/zilla/karapace.idl @@ -43,13 +43,13 @@ scope karapace int32 schemaId; } - struct KarapaceRetrievableSchemaSubjectVersionEx extends core::stream::Extension + struct KarapaceRetrievedSchemaSubjectVersionEx extends core::stream::Extension { string8 subject; string8 version; } - struct KarapaceRetrievableSchemaIdEx extends core::stream::Extension + struct KarapaceRetrievedSchemaIdEx extends core::stream::Extension { int32 schemaId; } @@ -59,8 +59,8 @@ scope karapace case UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION: KarapaceUnretrievableSchemaSubjectVersionEx unretrievableSchemaSubjectVersion; case UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA: KarapaceUnretrievableSchemaSubjectVersionStaleSchemaEx unretrievableSchemaSubjectVersionStaleSchema; case UNRETRIEVABLE_SCHEMA_ID: KarapaceUnretrievableSchemaIdEx unretrievableSchemaId; - case RETRIEVED_SCHEMA_SUBJECT_VERSION: KarapaceRetrievableSchemaSubjectVersionEx retrievableSchemaSubjectVersion; - case RETRIEVED_SCHEMA_ID: KarapaceRetrievableSchemaIdEx retrievableSchemaId; + case RETRIEVED_SCHEMA_SUBJECT_VERSION: KarapaceRetrievedSchemaSubjectVersionEx retrievedSchemaSubjectVersion; + case RETRIEVED_SCHEMA_ID: KarapaceRetrievedSchemaIdEx retrievedSchemaId; } } } diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml index 47edd6afed..df433b2e95 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml @@ -23,10 +23,12 @@ telemetry: events: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.id - message: UNRETRIEVABLE_SCHEMA_ID 9 + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_ID + message: Unable to fetch schema id 9. - qname: test.catalog0 - id: catalog.karapace.retrievable.schema.id - message: RETRIEVED_SCHEMA_ID 9 + id: catalog.karapace.retrieved.schema.id + name: CATALOG_KARAPACE_RETRIEVED_SCHEMA_ID + message: Successfully fetched schema id 9. catalogs: catalog0: type: karapace diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml index cfebc5d347..f917cdae5a 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml @@ -23,13 +23,16 @@ telemetry: events: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.subject.version - message: UNRETRIEVABLE_SCHEMA items-snapshots-value latest + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION + message: Unable to fetch schema for subject items-snapshots-value with version latest. - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.subject.version.stale.schema - message: UNRETRIEVABLE_SCHEMA items-snapshots-value latest, USING_STALE_SCHEMA 9 + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA + message: Unable to fetch schema for subject items-snapshots-value with version latest; using stale schema with id 9. - qname: test.catalog0 - id: catalog.karapace.retrievable.schema.subject.version - message: RETRIEVED_SCHEMA_SUBJECT_VERSION items-snapshots-value latest + id: catalog.karapace.retrieved.schema.subject.version + name: CATALOG_KARAPACE_RETRIEVED_SCHEMA_SUBJECT_VERSION + message: Successfully fetched schema for subject items-snapshots-value with version latest. catalogs: catalog0: type: karapace diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml index 0cdf18ac5f..88f28c49a2 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.id - message: UNRETRIEVABLE_SCHEMA_ID 1 + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_ID + message: Unable to fetch schema id 1. catalogs: catalog0: type: karapace diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml index 094974fe4b..28de1a1313 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.subject.version - message: UNRETRIEVABLE_SCHEMA items-snapshots-value latest + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION + message: Unable to fetch schema for subject items-snapshots-value with version latest. catalogs: catalog0: type: karapace diff --git a/specs/engine.spec/NOTICE b/specs/engine.spec/NOTICE index eb35495f05..8d88873c0d 100644 --- a/specs/engine.spec/NOTICE +++ b/specs/engine.spec/NOTICE @@ -19,8 +19,7 @@ This project includes: Java Unified Expression Language API under The Apache Software License, Version 2.0 Java Unified Expression Language Implementation under The Apache Software License, Version 2.0 JUnit under Eclipse Public License 1.0 - k3po/lang under The Apache Software License, Version 2.0 - Kaazing Corporation License under The Apache Software License, Version 2.0 + k3po::runtime::lang under The Apache Software License, Version 2.0 org.leadpony.justify under The Apache Software License, Version 2.0 diff --git a/specs/engine.spec/pom.xml b/specs/engine.spec/pom.xml index 47ec94237e..8e0e660576 100644 --- a/specs/engine.spec/pom.xml +++ b/specs/engine.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 0.11 18 - org.kaazing - k3po.lang + io.aklivity.k3po + lang jakarta.json @@ -68,8 +66,8 @@ - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test diff --git a/specs/engine.spec/src/main/java/io/aklivity/zilla/specs/engine/internal/CoreFunctions.java b/specs/engine.spec/src/main/java/io/aklivity/zilla/specs/engine/internal/CoreFunctions.java index 87cebafe59..c0128263b6 100644 --- a/specs/engine.spec/src/main/java/io/aklivity/zilla/specs/engine/internal/CoreFunctions.java +++ b/specs/engine.spec/src/main/java/io/aklivity/zilla/specs/engine/internal/CoreFunctions.java @@ -34,9 +34,9 @@ import org.agrona.BitUtil; import org.agrona.MutableDirectBuffer; import org.agrona.concurrent.UnsafeBuffer; -import org.kaazing.k3po.lang.el.Function; -import org.kaazing.k3po.lang.el.spi.FunctionMapperSpi; +import io.aklivity.k3po.runtime.lang.el.Function; +import io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi; import io.aklivity.zilla.specs.engine.internal.types.String16FW; import io.aklivity.zilla.specs.engine.internal.types.String8FW; import io.aklivity.zilla.specs.engine.internal.types.stream.Capability; diff --git a/specs/engine.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi b/specs/engine.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi similarity index 100% rename from specs/engine.spec/src/main/resources/META-INF/services/org.kaazing.k3po.lang.el.spi.FunctionMapperSpi rename to specs/engine.spec/src/main/resources/META-INF/services/io.aklivity.k3po.runtime.lang.el.spi.FunctionMapperSpi diff --git a/specs/engine.spec/src/main/resources/META-INF/zilla/core.idl b/specs/engine.spec/src/main/resources/META-INF/zilla/core.idl index 6e93622301..8806ef0513 100644 --- a/specs/engine.spec/src/main/resources/META-INF/zilla/core.idl +++ b/specs/engine.spec/src/main/resources/META-INF/zilla/core.idl @@ -111,5 +111,20 @@ scope core int64 namespacedId; octets extension; } + + enum EngineEventType (uint8) + { + CONFIG_WATCHER_FAILED (1) + } + + struct EngineConfigWatcherFailedEx extends core::stream::Extension + { + string16 reason; + } + + union EngineEventEx switch (EngineEventType) + { + case CONFIG_WATCHER_FAILED: EngineConfigWatcherFailedEx configWatcherFailed; + } } } diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/engine.events.yaml b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/engine.events.yaml new file mode 100644 index 0000000000..285f4abb06 --- /dev/null +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/engine.events.yaml @@ -0,0 +1,33 @@ +# +# Copyright 2021-2023 Aklivity Inc. +# +# Aklivity licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +--- +name: test +telemetry: + exporters: + exporter0: + type: test + options: + events: + - qname: engine.events + id: engine.config.watcher.failed + name: ENGINE_CONFIG_WATCHER_FAILED + message: Dynamic config reloading is disabled. [failed]. +bindings: + net0: + type: test + kind: server + exit: app0 diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/server.event.yaml b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/server.event.yaml index 7700f1a82b..2053ab0d4e 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/server.event.yaml +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/server.event.yaml @@ -24,6 +24,7 @@ telemetry: events: - qname: test.net0 id: binding.test.connected + name: BINDING_TEST_CONNECTED message: test event message bindings: net0: diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/schema/exporter/test.schema.patch.json b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/schema/exporter/test.schema.patch.json index 51d1bf8be6..5992cecce6 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/schema/exporter/test.schema.patch.json +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/schema/exporter/test.schema.patch.json @@ -48,6 +48,10 @@ { "type": "string" }, + "name": + { + "type": "string" + }, "message": { "type": "string" diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.create.via.http/client.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.create.via.http/client.rpt index 5093a82e2c..db208d88cd 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.create.via.http/client.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.create.via.http/client.rpt @@ -14,7 +14,7 @@ # under the License. # -connect "http://localhost:8080/" +connect "http://localhost:8080/zilla.yaml" connected write http:method "GET" @@ -23,13 +23,13 @@ write close read http:status "404" "Not Found" read closed -connect "http://localhost:8080/" + +connect "http://localhost:8080/zilla.yaml" connected write http:method "GET" write close -write notify FIRST_ABORTED read http:status "200" "OK" read http:header "Etag" "AAAAAAA" read '---\n' @@ -42,6 +42,16 @@ read '---\n' read closed + +connect "http://localhost:8080/zilla.yaml" +connected + +write http:method "GET" +write http:header "If-None-Match" "AAAAAAA" +write http:header "Prefer" "wait=86400" +write close + + connect "zilla://streams/app0" option zilla:window 8192 option zilla:transmission "duplex" diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.create.via.http/server.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.create.via.http/server.rpt index 1e59cdb65c..53f943cb58 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.create.via.http/server.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.create.via.http/server.rpt @@ -14,7 +14,9 @@ # under the License. # -accept "http://localhost:8080/" +accept "http://localhost:8080/zilla.yaml" + + accepted connected @@ -25,13 +27,13 @@ write http:status "404" "Not Found" write http:content-length write close + accepted connected read http:method "GET" read closed -write await FIRST_ABORTED write http:status "200" "OK" write http:content-length write http:header "Etag" "AAAAAAA" @@ -45,6 +47,16 @@ write '---\n' write close + +accepted +connected + +read http:method "GET" +read http:header "If-None-Match" "AAAAAAA" +read http:header "Prefer" "wait=86400" +read closed + + accept "zilla://streams/app0" option zilla:window 8192 option zilla:transmission "duplex" diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.delete.via.http/client.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.delete.via.http/client.rpt index bcf7ee1383..6f658f4624 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.delete.via.http/client.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.delete.via.http/client.rpt @@ -14,7 +14,7 @@ # under the License. # -connect "http://localhost:8080/" +connect "http://localhost:8080/zilla.yaml" connected write http:method "GET" @@ -31,22 +31,15 @@ read '---\n' ' exit: app0\n' read closed -connect "http://localhost:8080/" + +connect "http://localhost:8080/zilla.yaml" connected write http:method "GET" +write http:header "If-None-Match" "AAAAAAA" +write http:header "Prefer" "wait=86400" write close -write notify FIRST_CONNECTED read http:status "404" "Not Found" read closed -connect "zilla://streams/app0" - option zilla:window 8192 - option zilla:transmission "duplex" - -connected - -write notify CONFIG_DELETED -write abort -read abort \ No newline at end of file diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.delete.via.http/server.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.delete.via.http/server.rpt index ca7389f572..803a7cba72 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.delete.via.http/server.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.delete.via.http/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "http://localhost:8080/" +accept "http://localhost:8080/zilla.yaml" accepted connected @@ -33,24 +33,15 @@ write '---\n' ' exit: app0\n' write close + accepted connected read http:method "GET" +read http:header "If-None-Match" "AAAAAAA" +read http:header "Prefer" "wait=86400" read closed -write await FIRST_CONNECTED write http:status "404" "Not Found" write http:content-length write close - -accept "zilla://streams/app0" - option zilla:window 8192 - option zilla:transmission "duplex" - -accepted -connected - -read await CONFIG_DELETED -read aborted -write aborted diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.no.etag.via.http/client.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.no.etag.via.http/client.rpt index 791d9c4a1d..e5a646a6e9 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.no.etag.via.http/client.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.no.etag.via.http/client.rpt @@ -48,8 +48,8 @@ read closed connect "zilla://streams/app0" -option zilla:window 8192 -option zilla:transmission "duplex" + option zilla:window 8192 + option zilla:transmission "duplex" connected @@ -57,6 +57,6 @@ write abort read abort connect "zilla://streams/app1" -option zilla:window 8192 -option zilla:transmission "duplex" + option zilla:window 8192 + option zilla:transmission "duplex" connected \ No newline at end of file diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.no.etag.via.http/server.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.no.etag.via.http/server.rpt index a4130af69d..39d09dd14b 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.no.etag.via.http/server.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.no.etag.via.http/server.rpt @@ -57,7 +57,6 @@ accept "zilla://streams/app0" accepted connected -write notify CONNECTED read aborted write aborted diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.via.http/client.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.via.http/client.rpt index 99779dc0ff..6319e6f586 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.via.http/client.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.via.http/client.rpt @@ -14,7 +14,7 @@ # under the License. # -connect "http://localhost:8080/" +connect "http://localhost:8080/zilla.yaml" connected write http:method "GET" @@ -31,7 +31,8 @@ read '---\n' ' exit: app0\n' read closed -connect "http://localhost:8080/" + +connect "http://localhost:8080/zilla.yaml" connected write http:method "GET" @@ -51,16 +52,26 @@ read '---\n' read closed +connect "http://localhost:8080/zilla.yaml" +connected + +write http:method "GET" +write http:header "If-None-Match" "BBBBBBB" +write http:header "Prefer" "wait=86400" +write close + + connect "zilla://streams/app0" -option zilla:window 8192 -option zilla:transmission "duplex" + option zilla:window 8192 + option zilla:transmission "duplex" connected write abort read abort + connect "zilla://streams/app1" -option zilla:window 8192 -option zilla:transmission "duplex" -connected \ No newline at end of file + option zilla:window 8192 + option zilla:transmission "duplex" +connected diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.via.http/server.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.via.http/server.rpt index 1c15cfe74c..6f19b8e998 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.via.http/server.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.modify.via.http/server.rpt @@ -33,6 +33,7 @@ write '---\n' ' exit: app0\n' write close + accepted connected @@ -55,17 +56,26 @@ write '---\n' write close +accepted +connected + +read http:method "GET" +read http:header "If-None-Match" "BBBBBBB" +read http:header "Prefer" "wait=86400" +read closed + + accept "zilla://streams/app0" option zilla:window 8192 option zilla:transmission "duplex" accepted connected -write notify CONNECTED read aborted write aborted + accept "zilla://streams/app1" option zilla:window 8192 option zilla:transmission "duplex" diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.server.error.via.http/client.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.server.error.via.http/client.rpt index 26634d7379..c55613190b 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.server.error.via.http/client.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.server.error.via.http/client.rpt @@ -14,7 +14,7 @@ # under the License. # -connect "http://localhost:8080/" +connect "http://localhost:8080/zilla.yaml" connected write http:method "GET" @@ -31,7 +31,7 @@ read '---\n' ' exit: app0\n' read closed -connect "http://localhost:8080/" +connect "http://localhost:8080/zilla.yaml" connected write http:method "GET" @@ -44,11 +44,11 @@ read closed connect "zilla://streams/app0" -option zilla:window 8192 -option zilla:transmission "duplex" + option zilla:window 8192 + option zilla:transmission "duplex" connected connect "zilla://streams/app0" -option zilla:window 8192 -option zilla:transmission "duplex" -connected \ No newline at end of file + option zilla:window 8192 + option zilla:transmission "duplex" +connected diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.server.error.via.http/server.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.server.error.via.http/server.rpt index 7db63f1708..d51b937052 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.server.error.via.http/server.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/application/reconfigure.server.error.via.http/server.rpt @@ -14,7 +14,7 @@ # under the License. # -accept "http://localhost:8080/" +accept "http://localhost:8080/zilla.yaml" accepted connected @@ -53,6 +53,6 @@ accept "zilla://streams/app0" accepted connected -write notify CONNECTED + accepted -connected \ No newline at end of file +connected diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.create.via.http/client.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.create.via.http/client.rpt index 1aa54a359f..e1c5e4dec0 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.create.via.http/client.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.create.via.http/client.rpt @@ -14,13 +14,6 @@ # under the License. # - -connect "zilla://streams/net0" - option zilla:transmission "duplex" - option zilla:window 8192 -connect aborted -write notify FIRST_ABORTED - connect await CONFIG_CREATED "zilla://streams/net0" option zilla:transmission "duplex" diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.create.via.http/server.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.create.via.http/server.rpt index b11e21ce12..5867b43b1e 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.create.via.http/server.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.create.via.http/server.rpt @@ -14,13 +14,9 @@ # under the License. # - accept "zilla://streams/net0" option zilla:transmission "duplex" option zilla:window 8192 -rejected - -write notify CONFIG_CREATED accepted connected diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.delete.via.http/client.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.delete.via.http/client.rpt index 0cf89384dc..d7c3cbf35f 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.delete.via.http/client.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.delete.via.http/client.rpt @@ -14,15 +14,6 @@ # under the License. # -connect "zilla://streams/net0" - option zilla:transmission "duplex" - option zilla:window 8192 -connected -write notify FIRST_CONNECTED - -write aborted -read abort - connect await CONFIG_DELETED "zilla://streams/net0" option zilla:transmission "duplex" diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.delete.via.http/server.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.delete.via.http/server.rpt index b6386becc9..c288e29dbb 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.delete.via.http/server.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.delete.via.http/server.rpt @@ -14,15 +14,8 @@ # under the License. # - accept "zilla://streams/net0" option zilla:transmission "duplex" option zilla:window 8192 -accepted -connected - -write notify CONFIG_DELETED -read abort -write aborted rejected diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.no.etag.via.http/client.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.no.etag.via.http/client.rpt index 1c86918d66..b72ea7b4f6 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.no.etag.via.http/client.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.no.etag.via.http/client.rpt @@ -19,6 +19,8 @@ connect "zilla://streams/net0" option zilla:window 8192 connected +write notify CONNECTED + write aborted read abort diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.no.etag.via.http/server.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.no.etag.via.http/server.rpt index 0649d05dc8..87be4cb467 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.no.etag.via.http/server.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.no.etag.via.http/server.rpt @@ -17,14 +17,17 @@ accept "zilla://streams/net0" option zilla:transmission "duplex" option zilla:window 8192 + accepted connected write notify CONFIG_CHANGED read abort write aborted + rejected + accept "zilla://streams/net1" option zilla:transmission "duplex" option zilla:window 8192 diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.via.http/client.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.via.http/client.rpt index 1c86918d66..b72ea7b4f6 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.via.http/client.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.via.http/client.rpt @@ -19,6 +19,8 @@ connect "zilla://streams/net0" option zilla:window 8192 connected +write notify CONNECTED + write aborted read abort diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.via.http/server.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.via.http/server.rpt index 0649d05dc8..5804f1545f 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.via.http/server.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.modify.via.http/server.rpt @@ -17,14 +17,18 @@ accept "zilla://streams/net0" option zilla:transmission "duplex" option zilla:window 8192 + accepted connected write notify CONFIG_CHANGED read abort write aborted + + rejected + accept "zilla://streams/net1" option zilla:transmission "duplex" option zilla:window 8192 diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.server.error.via.http/client.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.server.error.via.http/client.rpt index bd64496704..b79f1b71f2 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.server.error.via.http/client.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.server.error.via.http/client.rpt @@ -19,9 +19,13 @@ connect "zilla://streams/net0" option zilla:window 8192 connected +read notify CONNECTED + + connect await SERVER_ERROR "zilla://streams/net0" option zilla:transmission "duplex" option zilla:window 8192 connected + write notify CHECK_RECONFIGURE diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.server.error.via.http/server.rpt b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.server.error.via.http/server.rpt index 5beb68d59e..0af1c48c59 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.server.error.via.http/server.rpt +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/streams/network/reconfigure.server.error.via.http/server.rpt @@ -17,9 +17,9 @@ accept "zilla://streams/net0" option zilla:transmission "duplex" option zilla:window 8192 + accepted connected -write notify SERVER_ERROR accepted connected \ No newline at end of file diff --git a/specs/engine.spec/src/test/java/io/aklivity/zilla/specs/engine/streams/ApplicationIT.java b/specs/engine.spec/src/test/java/io/aklivity/zilla/specs/engine/streams/ApplicationIT.java index 65c49ae5a6..ed9a73beea 100644 --- a/specs/engine.spec/src/test/java/io/aklivity/zilla/specs/engine/streams/ApplicationIT.java +++ b/specs/engine.spec/src/test/java/io/aklivity/zilla/specs/engine/streams/ApplicationIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ApplicationIT { @@ -86,7 +87,7 @@ public void shouldNotReconfigureWhenModifiedButParseFailed() throws Exception @Specification({ "${app}/reconfigure.modify.via.http/client", "${app}/reconfigure.modify.via.http/server" }) - public void shouldReconfigureWhenModifiedHTTP() throws Exception + public void shouldReconfigureWhenModifiedViaHttp() throws Exception { k3po.finish(); } @@ -95,7 +96,7 @@ public void shouldReconfigureWhenModifiedHTTP() throws Exception @Specification({ "${app}/reconfigure.create.via.http/client", "${app}/reconfigure.create.via.http/server" }) - public void shouldReconfigureWhenCreatedHTTP() throws Exception + public void shouldReconfigureWhenCreatedViaHttp() throws Exception { k3po.finish(); } @@ -104,7 +105,7 @@ public void shouldReconfigureWhenCreatedHTTP() throws Exception @Specification({ "${app}/reconfigure.delete.via.http/client", "${app}/reconfigure.delete.via.http/server" }) - public void shouldReconfigureWhenDeletedHTTP() throws Exception + public void shouldReconfigureWhenDeletedViaHttp() throws Exception { k3po.finish(); } @@ -114,7 +115,7 @@ public void shouldReconfigureWhenDeletedHTTP() throws Exception "${app}/reconfigure.modify.no.etag.via.http/server", "${app}/reconfigure.modify.no.etag.via.http/client" }) - public void shouldReconfigureWhenModifiedHTTPEtagNotSupported() throws Exception + public void shouldReconfigureWhenModifiedViaHttpEtagNotSupported() throws Exception { k3po.finish(); } @@ -124,7 +125,7 @@ public void shouldReconfigureWhenModifiedHTTPEtagNotSupported() throws Exception "${app}/reconfigure.server.error.via.http/server", "${app}/reconfigure.server.error.via.http/client" }) - public void shouldNotReconfigureWhen500Returned() throws Exception + public void shouldNotReconfigureViaHttpWhenServerError() throws Exception { k3po.finish(); } diff --git a/specs/engine.spec/src/test/java/io/aklivity/zilla/specs/engine/streams/NetworkIT.java b/specs/engine.spec/src/test/java/io/aklivity/zilla/specs/engine/streams/NetworkIT.java index ff59b85799..8330551345 100644 --- a/specs/engine.spec/src/test/java/io/aklivity/zilla/specs/engine/streams/NetworkIT.java +++ b/specs/engine.spec/src/test/java/io/aklivity/zilla/specs/engine/streams/NetworkIT.java @@ -23,8 +23,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class NetworkIT { @@ -86,8 +87,10 @@ public void shouldNotReconfigureWhenModifiedButParseFailed() throws Exception @Specification({ "${net}/reconfigure.modify.via.http/client", "${net}/reconfigure.modify.via.http/server" }) - public void shouldReconfigureWhenModifiedHTTP() throws Exception + public void shouldReconfigureWhenModifiedViaHttp() throws Exception { + k3po.start(); + k3po.notifyBarrier("CONFIG_CHANGED"); k3po.finish(); } @@ -95,8 +98,10 @@ public void shouldReconfigureWhenModifiedHTTP() throws Exception @Specification({ "${net}/reconfigure.create.via.http/client", "${net}/reconfigure.create.via.http/server" }) - public void shouldReconfigureWhenCreatedHTTP() throws Exception + public void shouldReconfigureWhenCreatedViaHttp() throws Exception { + k3po.start(); + k3po.notifyBarrier("CONFIG_CREATED"); k3po.finish(); } @@ -104,8 +109,10 @@ public void shouldReconfigureWhenCreatedHTTP() throws Exception @Specification({ "${net}/reconfigure.delete.via.http/client", "${net}/reconfigure.delete.via.http/server" }) - public void shouldReconfigureWhenDeletedHTTP() throws Exception + public void shouldReconfigureWhenDeletedViaHttp() throws Exception { + k3po.start(); + k3po.notifyBarrier("CONFIG_DELETED"); k3po.finish(); } @@ -114,7 +121,7 @@ public void shouldReconfigureWhenDeletedHTTP() throws Exception "${net}/reconfigure.modify.no.etag.via.http/server", "${net}/reconfigure.modify.no.etag.via.http/client" }) - public void shouldReconfigureWhenModifiedHTTPEtagNotSupported() throws Exception + public void shouldReconfigureWhenModifiedViaHttpEtagNotSupported() throws Exception { k3po.finish(); } @@ -124,8 +131,10 @@ public void shouldReconfigureWhenModifiedHTTPEtagNotSupported() throws Exception "${net}/reconfigure.server.error.via.http/server", "${net}/reconfigure.server.error.via.http/client" }) - public void shouldNotReconfigureWhen500Returned() throws Exception + public void shouldNotReconfigureViaHttpWhenServerError() throws Exception { + k3po.start(); + k3po.notifyBarrier("SERVER_ERROR"); k3po.finish(); } } diff --git a/specs/exporter-otlp.spec/pom.xml b/specs/exporter-otlp.spec/pom.xml index 5fb45e3a06..d91487052c 100644 --- a/specs/exporter-otlp.spec/pom.xml +++ b/specs/exporter-otlp.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -110,7 +108,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/client.rpt b/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/client.rpt index ac70d76711..96bb6a9a1e 100644 --- a/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/client.rpt +++ b/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/client.rpt @@ -51,7 +51,7 @@ write '{' '"key":"event.name",' '"value":{' - '"stringValue":"binding.test.connected"' + '"stringValue":"BINDING_TEST_CONNECTED"' '}' '}' ']' diff --git a/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/server.rpt b/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/server.rpt index 8f79319539..8ca3aa4dad 100644 --- a/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/server.rpt +++ b/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/server.rpt @@ -52,7 +52,7 @@ read '{' '"key":"event.name",' '"value":{' - '"stringValue":"binding.test.connected"' + '"stringValue":"BINDING_TEST_CONNECTED"' '}' '}' ']' diff --git a/specs/exporter-otlp.spec/src/test/java/io/aklivity/zilla/specs/exporter/otlp/ApplicationIT.java b/specs/exporter-otlp.spec/src/test/java/io/aklivity/zilla/specs/exporter/otlp/ApplicationIT.java index d1ce5f2a00..c68cb6a189 100644 --- a/specs/exporter-otlp.spec/src/test/java/io/aklivity/zilla/specs/exporter/otlp/ApplicationIT.java +++ b/specs/exporter-otlp.spec/src/test/java/io/aklivity/zilla/specs/exporter/otlp/ApplicationIT.java @@ -22,8 +22,9 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.kaazing.k3po.junit.annotation.Specification; -import org.kaazing.k3po.junit.rules.K3poRule; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; public class ApplicationIT { diff --git a/specs/exporter-prometheus.spec/pom.xml b/specs/exporter-prometheus.spec/pom.xml index e42cd94f30..4af499f65a 100644 --- a/specs/exporter-prometheus.spec/pom.xml +++ b/specs/exporter-prometheus.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -110,7 +108,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/exporter-stdout.spec/pom.xml b/specs/exporter-stdout.spec/pom.xml index 93ae11bbbe..1dabefeb5e 100644 --- a/specs/exporter-stdout.spec/pom.xml +++ b/specs/exporter-stdout.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -117,7 +115,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/filesystem-http.spec/COPYRIGHT b/specs/filesystem-http.spec/COPYRIGHT new file mode 100644 index 0000000000..0cb10b6f62 --- /dev/null +++ b/specs/filesystem-http.spec/COPYRIGHT @@ -0,0 +1,12 @@ +Copyright ${copyrightYears} Aklivity Inc + +Licensed under the Aklivity Community License (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at + + https://www.aklivity.io/aklivity-community-license/ + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +WARRANTIES OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. diff --git a/specs/filesystem-http.spec/LICENSE b/specs/filesystem-http.spec/LICENSE new file mode 100644 index 0000000000..f6abb6327b --- /dev/null +++ b/specs/filesystem-http.spec/LICENSE @@ -0,0 +1,114 @@ + Aklivity Community License Agreement + Version 1.0 + +This Aklivity Community License Agreement Version 1.0 (the “Agreement”) sets +forth the terms on which Aklivity, Inc. (“Aklivity”) makes available certain +software made available by Aklivity under this Agreement (the “Software”). BY +INSTALLING, DOWNLOADING, ACCESSING, USING OR DISTRIBUTING ANY OF THE SOFTWARE, +YOU AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO +SUCH TERMS AND CONDITIONS, YOU MUST NOT USE THE SOFTWARE. IF YOU ARE RECEIVING +THE SOFTWARE ON BEHALF OF A LEGAL ENTITY, YOU REPRESENT AND WARRANT THAT YOU +HAVE THE ACTUAL AUTHORITY TO AGREE TO THE TERMS AND CONDITIONS OF THIS +AGREEMENT ON BEHALF OF SUCH ENTITY. “Licensee” means you, an individual, or +the entity on whose behalf you are receiving the Software. + + 1. LICENSE GRANT AND CONDITIONS. + + 1.1 License. Subject to the terms and conditions of this Agreement, + Aklivity hereby grants to Licensee a non-exclusive, royalty-free, + worldwide, non-transferable, non-sublicenseable license during the term + of this Agreement to: (a) use the Software; (b) prepare modifications and + derivative works of the Software; (c) distribute the Software (including + without limitation in source code or object code form); and (d) reproduce + copies of the Software (the “License”). Licensee is not granted the + right to, and Licensee shall not, exercise the License for an Excluded + Purpose. For purposes of this Agreement, “Excluded Purpose” means making + available any software-as-a-service, platform-as-a-service, + infrastructure-as-a-service or other similar online service that competes + with Aklivity products or services that provide the Software. + + 1.2 Conditions. In consideration of the License, Licensee’s distribution + of the Software is subject to the following conditions: + + (a) Licensee must cause any Software modified by Licensee to carry + prominent notices stating that Licensee modified the Software. + + (b) On each Software copy, Licensee shall reproduce and not remove or + alter all Aklivity or third party copyright or other proprietary + notices contained in the Software, and Licensee must provide the + notice below with each copy. + + “This software is made available by Aklivity, Inc., under the + terms of the Aklivity Community License Agreement, Version 1.0 + located at http://www.Aklivity.io/Aklivity-community-license. BY + INSTALLING, DOWNLOADING, ACCESSING, USING OR DISTRIBUTING ANY OF + THE SOFTWARE, YOU AGREE TO THE TERMS OF SUCH LICENSE AGREEMENT.” + + 1.3 Licensee Modifications. Licensee may add its own copyright notices + to modifications made by Licensee and may provide additional or different + license terms and conditions for use, reproduction, or distribution of + Licensee’s modifications. While redistributing the Software or + modifications thereof, Licensee may choose to offer, for a fee or free of + charge, support, warranty, indemnity, or other obligations. Licensee, and + not Aklivity, will be responsible for any such obligations. + + 1.4 No Sublicensing. The License does not include the right to + sublicense the Software, however, each recipient to which Licensee + provides the Software may exercise the Licenses so long as such recipient + agrees to the terms and conditions of this Agreement. + + 2. TERM AND TERMINATION. This Agreement will continue unless and until + earlier terminated as set forth herein. If Licensee breaches any of its + conditions or obligations under this Agreement, this Agreement will + terminate automatically and the License will terminate automatically and + permanently. + + 3. INTELLECTUAL PROPERTY. As between the parties, Aklivity will retain all + right, title, and interest in the Software, and all intellectual property + rights therein. Aklivity hereby reserves all rights not expressly granted + to Licensee in this Agreement. Aklivity hereby reserves all rights in its + trademarks and service marks, and no licenses therein are granted in this + Agreement. + + 4. DISCLAIMER. Aklivity HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND + CONDITIONS, EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, AND SPECIFICALLY + DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR + PURPOSE, WITH RESPECT TO THE SOFTWARE. + + 5. LIMITATION OF LIABILITY. Aklivity WILL NOT BE LIABLE FOR ANY DAMAGES OF + ANY KIND, INCLUDING BUT NOT LIMITED TO, LOST PROFITS OR ANY CONSEQUENTIAL, + SPECIAL, INCIDENTAL, INDIRECT, OR DIRECT DAMAGES, HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, ARISING OUT OF THIS AGREEMENT. THE FOREGOING SHALL + APPLY TO THE EXTENT PERMITTED BY APPLICABLE LAW. + + 6.GENERAL. + + 6.1 Governing Law. This Agreement will be governed by and interpreted in + accordance with the laws of the state of California, without reference to + its conflict of laws principles. If Licensee is located within the + United States, all disputes arising out of this Agreement are subject to + the exclusive jurisdiction of courts located in Santa Clara County, + California. USA. If Licensee is located outside of the United States, + any dispute, controversy or claim arising out of or relating to this + Agreement will be referred to and finally determined by arbitration in + accordance with the JAMS International Arbitration Rules. The tribunal + will consist of one arbitrator. The place of arbitration will be Palo + Alto, California. The language to be used in the arbitral proceedings + will be English. Judgment upon the award rendered by the arbitrator may + be entered in any court having jurisdiction thereof. + + 6.2 Assignment. Licensee is not authorized to assign its rights under + this Agreement to any third party. Aklivity may freely assign its rights + under this Agreement to any third party. + + 6.3 Other. This Agreement is the entire agreement between the parties + regarding the subject matter hereof. No amendment or modification of + this Agreement will be valid or binding upon the parties unless made in + writing and signed by the duly authorized representatives of both + parties. In the event that any provision, including without limitation + any condition, of this Agreement is held to be unenforceable, this + Agreement and all licenses and rights granted hereunder will immediately + terminate. Waiver by Aklivity of a breach of any provision of this + Agreement or the failure by Aklivity to exercise any right hereunder + will not be construed as a waiver of any subsequent breach of that right + or as a waiver of any other right. \ No newline at end of file diff --git a/specs/filesystem-http.spec/NOTICE b/specs/filesystem-http.spec/NOTICE new file mode 100644 index 0000000000..9024d8926d --- /dev/null +++ b/specs/filesystem-http.spec/NOTICE @@ -0,0 +1,13 @@ +Licensed under the Aklivity Community License (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at + + https://www.aklivity.io/aklivity-community-license/ + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +WARRANTIES OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. + +This project includes: + diff --git a/specs/filesystem-http.spec/NOTICE.template b/specs/filesystem-http.spec/NOTICE.template new file mode 100644 index 0000000000..209ca12f74 --- /dev/null +++ b/specs/filesystem-http.spec/NOTICE.template @@ -0,0 +1,13 @@ +Licensed under the Aklivity Community License (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at + + https://www.aklivity.io/aklivity-community-license/ + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +WARRANTIES OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. + +This project includes: +#GENERATED_NOTICES# diff --git a/specs/filesystem-http.spec/mvnw b/specs/filesystem-http.spec/mvnw new file mode 100755 index 0000000000..d2f0ea3808 --- /dev/null +++ b/specs/filesystem-http.spec/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven2 Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/specs/filesystem-http.spec/mvnw.cmd b/specs/filesystem-http.spec/mvnw.cmd new file mode 100644 index 0000000000..b26ab24f03 --- /dev/null +++ b/specs/filesystem-http.spec/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/specs/filesystem-http.spec/pom.xml b/specs/filesystem-http.spec/pom.xml new file mode 100644 index 0000000000..f910741cc9 --- /dev/null +++ b/specs/filesystem-http.spec/pom.xml @@ -0,0 +1,123 @@ + + + + 4.0.0 + + io.aklivity.zilla + specs + 0.9.83 + ../pom.xml + + + filesystem-http.spec + zilla::specs::filesystem-http.spec + + + + Aklivity Community License Agreement + https://www.aklivity.io/aklivity-community-license/ + repo + + + + + 1.00 + 0 + + + + + junit + junit + test + + + io.aklivity.k3po + lang + provided + + + io.aklivity.k3po + control-junit + test + + + org.hamcrest + hamcrest-library + test + + + + + + + src/main/resources + + + src/main/scripts + + + + + + org.jasig.maven + maven-notice-plugin + + + com.mycila + license-maven-plugin + + + maven-checkstyle-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + + org.moditect + moditect-maven-plugin + + + io.aklivity.k3po + k3po-maven-plugin + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + org.jacoco + jacoco-maven-plugin + + + + BUNDLE + + + INSTRUCTION + COVEREDRATIO + ${jacoco.coverage.ratio} + + + CLASS + MISSEDCOUNT + ${jacoco.missed.count} + + + + + + + + + diff --git a/specs/filesystem-http.spec/src/main/moditect/module-info.java b/specs/filesystem-http.spec/src/main/moditect/module-info.java new file mode 100644 index 0000000000..a7fac52d06 --- /dev/null +++ b/specs/filesystem-http.spec/src/main/moditect/module-info.java @@ -0,0 +1,17 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +open module io.aklivity.zilla.specs.filesystem.http +{ +} diff --git a/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.notfound.success/client.rpt b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.notfound.success/client.rpt new file mode 100644 index 0000000000..7709573bb1 --- /dev/null +++ b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.notfound.success/client.rpt @@ -0,0 +1,36 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "http://localhost:8080/hello.txt" +connected + +write http:method "GET" +write close + +read http:status "404" "Not Found" +read notify FIRST_READ +read closed + +connect "http://localhost:8080/hello.txt" +connected + +write await FIRST_READ +write http:method "GET" +write close + +read http:status "200" "OK" +read http:header "Etag" "AAAAAAA" +read "Hello World!" +read closed diff --git a/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.notfound.success/server.rpt b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.notfound.success/server.rpt new file mode 100644 index 0000000000..74dfcfc1a7 --- /dev/null +++ b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.notfound.success/server.rpt @@ -0,0 +1,37 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "http://localhost:8080/hello.txt" +accepted +connected + +read http:method "GET" +read closed + +write http:status "404" "Not Found" +write http:content-length +write close + +accepted +connected + +read http:method "GET" +read closed + +write http:status "200" "OK" +write http:content-length +write http:header "Etag" "AAAAAAA" +write "Hello World!" +write close diff --git a/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.notfound/client.rpt b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.notfound/client.rpt new file mode 100644 index 0000000000..c373f679d7 --- /dev/null +++ b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.notfound/client.rpt @@ -0,0 +1,23 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "http://localhost:8080/notfound.txt" +connected + +write http:method "GET" +write close + +read http:status "404" "Not Found" +read closed diff --git a/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.notfound/server.rpt b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.notfound/server.rpt new file mode 100644 index 0000000000..179a436744 --- /dev/null +++ b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.notfound/server.rpt @@ -0,0 +1,25 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "http://localhost:8080/notfound.txt" +accepted +connected + +read http:method "GET" +read closed + +write http:status "404" "Not Found" +write http:content-length +write close diff --git a/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success.etag.modified/client.rpt b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success.etag.modified/client.rpt new file mode 100644 index 0000000000..27e498af0c --- /dev/null +++ b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success.etag.modified/client.rpt @@ -0,0 +1,39 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "http://localhost:8080/hello.txt" +connected + +write http:method "GET" +write close + +read http:status "200" "OK" +read http:header "Etag" "AAAAAAA" +read "Hello World!" +read notify FIRST_READ +read closed + +connect "http://localhost:8080/hello.txt" +connected + +write await FIRST_READ +write http:method "GET" +write http:header "If-None-Match" "AAAAAAA" +write close + +read http:status "200" "OK" +read http:header "Etag" "BBBBBBB" +read "Hello Universe!" +read closed diff --git a/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success.etag.modified/server.rpt b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success.etag.modified/server.rpt new file mode 100644 index 0000000000..0052eb0bf2 --- /dev/null +++ b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success.etag.modified/server.rpt @@ -0,0 +1,40 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "http://localhost:8080/hello.txt" +accepted +connected + +read http:method "GET" +read closed + +write http:status "200" "OK" +write http:content-length +write http:header "Etag" "AAAAAAA" +write "Hello World!" +write close + +accepted +connected + +read http:method "GET" +read http:header "If-None-Match" "AAAAAAA" +read closed + +write http:status "200" "OK" +write http:content-length +write http:header "Etag" "BBBBBBB" +write "Hello Universe!" +write close diff --git a/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success.etag.not.modified/client.rpt b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success.etag.not.modified/client.rpt new file mode 100644 index 0000000000..68a283c0c5 --- /dev/null +++ b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success.etag.not.modified/client.rpt @@ -0,0 +1,38 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "http://localhost:8080/hello.txt" +connected + +write http:method "GET" +write close + +read http:status "200" "OK" +read http:header "Etag" "AAAAAAA" +read "Hello World!" +read notify FIRST_READ +read closed + +connect "http://localhost:8080/hello.txt" +connected + +write await FIRST_READ +write http:method "GET" +write http:header "If-None-Match" "AAAAAAA" +write close + +read http:status "304" "Not Modified" +read http:header "Etag" "AAAAAAA" +read closed diff --git a/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success.etag.not.modified/server.rpt b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success.etag.not.modified/server.rpt new file mode 100644 index 0000000000..1c7c544b51 --- /dev/null +++ b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success.etag.not.modified/server.rpt @@ -0,0 +1,39 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "http://localhost:8080/hello.txt" +accepted +connected + +read http:method "GET" +read closed + +write http:status "200" "OK" +write http:content-length +write http:header "Etag" "AAAAAAA" +write "Hello World!" +write close + +accepted +connected + +read http:method "GET" +read http:header "If-None-Match" "AAAAAAA" +read closed + +write http:status "304" "Not Modified" +write http:content-length +write http:header "Etag" "AAAAAAA" +write close diff --git a/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success/client.rpt b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success/client.rpt new file mode 100644 index 0000000000..c6134a366a --- /dev/null +++ b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success/client.rpt @@ -0,0 +1,25 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "http://localhost:8080/hello.txt" +connected + +write http:method "GET" +write close + +read http:status "200" "OK" +read http:header "Etag" "AAAAAAA" +read "Hello World!" +read closed diff --git a/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success/server.rpt b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success/server.rpt new file mode 100644 index 0000000000..fc0194bdbd --- /dev/null +++ b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/read.success/server.rpt @@ -0,0 +1,27 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "http://localhost:8080/hello.txt" +accepted +connected + +read http:method "GET" +read closed + +write http:status "200" "OK" +write http:content-length +write http:header "Etag" "AAAAAAA" +write "Hello World!" +write close diff --git a/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/watch.read/client.rpt b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/watch.read/client.rpt new file mode 100644 index 0000000000..44ef7dc8fe --- /dev/null +++ b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/watch.read/client.rpt @@ -0,0 +1,78 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "http://localhost:8080/hello.txt" +connected + +write http:method "GET" +write close + +read http:status "200" "OK" +read http:header "Etag" "AAAAAAA" +read "Hello World!" +read closed +read notify CONFIG_INITIALIZED + + +connect await CONFIG_INITIALIZED + "http://localhost:8080/hello.txt" +connected + +write http:method "GET" +write http:header "If-None-Match" "AAAAAAA" +write http:header "Prefer" "wait=86400" +write close + +read http:status "200" "OK" +read http:header "Etag" "AAAAAAA" +read "Hello World!" +read closed +read notify CONFIG_IDENTICAL + +connect await CONFIG_IDENTICAL + "http://localhost:8080/hello.txt" +connected + +write http:method "GET" +write http:header "If-None-Match" "AAAAAAA" +write http:header "Prefer" "wait=86400" +write close + +read http:status "200" "OK" +read http:header "Etag" "BBBBBBB" +read "Hello Universe!" +read closed +read notify CONFIG_MODIFIED + +connect await CONFIG_MODIFIED + "http://localhost:8080/hello.txt" +connected + +write http:method "GET" +write http:header "If-None-Match" "BBBBBBB" +write http:header "Prefer" "wait=86400" +write close + +read http:status "304" "Not changed" +read closed +read notify CONFIG_NOT_MODIFIED + +connect await CONFIG_NOT_MODIFIED + "http://localhost:8080/hello.txt" +connected + +write http:method "GET" +write http:header "If-None-Match" "BBBBBBB" +write close diff --git a/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/watch.read/server.rpt b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/watch.read/server.rpt new file mode 100644 index 0000000000..c1d51dd9b1 --- /dev/null +++ b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/watch.read/server.rpt @@ -0,0 +1,83 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "http://localhost:8080/hello.txt" + +accepted +connected + +read http:method "GET" +read closed + +write http:status "200" "OK" +write http:content-length +write http:header "Etag" "AAAAAAA" +write "Hello World!" +write close + + +accepted +connected + +read http:method "GET" +read http:header "If-None-Match" "AAAAAAA" +read http:header "Prefer" "wait=86400" +read closed + +write http:status "200" "OK" +write http:content-length +write http:header "Etag" "AAAAAAA" +write "Hello World!" +write close + + +accepted +connected + +read http:method "GET" +read http:header "If-None-Match" "AAAAAAA" +read http:header "Prefer" "wait=86400" +read closed + +write http:status "200" "OK" +write http:content-length +write http:header "Etag" "BBBBBBB" +write "Hello Universe!" +write close + + +accepted +connected + +read http:method "GET" +read http:header "If-None-Match" "BBBBBBB" +read http:header "Prefer" "wait=86400" +read closed + +write http:status "304" "Not changed" +write http:content-length +write close + + +accepted +connected + +read http:method "GET" +read http:header "If-None-Match" "BBBBBBB" +read closed + +write http:status "304" "Not changed" +write http:content-length +write close diff --git a/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/watch/client.rpt b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/watch/client.rpt new file mode 100644 index 0000000000..28bac19a0b --- /dev/null +++ b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/watch/client.rpt @@ -0,0 +1,40 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "http://localhost:8080/hello.txt" +connected + +write http:method "GET" +write close + +read notify REGISTERED +read http:status "200" "OK" +read http:header "Etag" "AAAAAAA" +read "Hello World!" +read closed + +connect "http://localhost:8080/hello.txt" +connected + +write http:method "GET" +write http:header "If-None-Match" "AAAAAAA" +write http:header "Prefer" "wait=86400" +write close + +read notify MODIFIED +read http:status "200" "OK" +read http:header "Etag" "BBBBBBB" +read "Hello Universe!" +read closed diff --git a/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/watch/server.rpt b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/watch/server.rpt new file mode 100644 index 0000000000..5b330c1ffc --- /dev/null +++ b/specs/filesystem-http.spec/src/main/scripts/io/aklivity/zilla/specs/filesystem/http/application/watch/server.rpt @@ -0,0 +1,43 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "http://localhost:8080/hello.txt" +accepted +connected + +read http:method "GET" +read closed + +write await REGISTERED +write http:status "200" "OK" +write http:content-length +write http:header "Etag" "AAAAAAA" +write "Hello World!" +write close + +accepted +connected + +read http:method "GET" +read http:header "If-None-Match" "AAAAAAA" +read http:header "Prefer" "wait=86400" +read closed + +write await MODIFIED +write http:status "200" "OK" +write http:content-length +write http:header "Etag" "BBBBBBB" +write "Hello Universe!" +write close diff --git a/specs/filesystem-http.spec/src/test/java/io/aklivity/zilla/specs/filesystem/http/ApplicationIT.java b/specs/filesystem-http.spec/src/test/java/io/aklivity/zilla/specs/filesystem/http/ApplicationIT.java new file mode 100644 index 0000000000..54003f25fe --- /dev/null +++ b/specs/filesystem-http.spec/src/test/java/io/aklivity/zilla/specs/filesystem/http/ApplicationIT.java @@ -0,0 +1,101 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.specs.filesystem.http; + +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.rules.RuleChain.outerRule; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.DisableOnDebug; +import org.junit.rules.TestRule; +import org.junit.rules.Timeout; + +import io.aklivity.k3po.runtime.junit.annotation.Specification; +import io.aklivity.k3po.runtime.junit.rules.K3poRule; + +public class ApplicationIT +{ + private final K3poRule k3po = new K3poRule() + .addScriptRoot("app", "io/aklivity/zilla/specs/filesystem/http/application"); + + private final TestRule timeout = new DisableOnDebug(new Timeout(5, SECONDS)); + + @Rule + public final TestRule chain = outerRule(k3po).around(timeout); + + @Test + @Specification({ + "${app}/read.success/client", + "${app}/read.success/server" }) + public void shouldReadString() throws Exception + { + k3po.finish(); + } + + @Test + @Specification({ + "${app}/read.success.etag.not.modified/client", + "${app}/read.success.etag.not.modified/server" }) + public void shouldReadStringEtagNotModified() throws Exception + { + k3po.finish(); + } + + @Test + @Specification({ + "${app}/read.success.etag.modified/client", + "${app}/read.success.etag.modified/server" }) + public void shouldReadStringEtagModified() throws Exception + { + k3po.finish(); + } + + @Test + @Specification({ + "${app}/read.notfound/client", + "${app}/read.notfound/server" }) + public void shouldReadStringNotFound() throws Exception + { + k3po.finish(); + } + + @Test + @Specification({ + "${app}/read.notfound.success/client", + "${app}/read.notfound.success/server" }) + public void shouldReadStringNotFoundSuccess() throws Exception + { + k3po.finish(); + } + + @Test + @Specification({ + "${app}/watch/client", + "${app}/watch/server" }) + public void shouldWatch() throws Exception + { + k3po.finish(); + } + + @Test + @Specification({ + "${app}/watch.read/client", + "${app}/watch.read/server" }) + public void shouldWatchRead() throws Exception + { + k3po.finish(); + } +} diff --git a/specs/guard-jwt.spec/NOTICE b/specs/guard-jwt.spec/NOTICE index ed4c502c75..fa9b8adebc 100644 --- a/specs/guard-jwt.spec/NOTICE +++ b/specs/guard-jwt.spec/NOTICE @@ -16,8 +16,7 @@ This project includes: Jakarta JSON Processing API under Eclipse Public License 2.0 or GNU General Public License, version 2 with the GNU Classpath Exception Java Unified Expression Language API under The Apache Software License, Version 2.0 Java Unified Expression Language Implementation under The Apache Software License, Version 2.0 - k3po/lang under The Apache Software License, Version 2.0 - Kaazing Corporation License under The Apache Software License, Version 2.0 + k3po::runtime::lang under The Apache Software License, Version 2.0 org.leadpony.justify under The Apache Software License, Version 2.0 zilla::specs::engine.spec under The Apache Software License, Version 2.0 diff --git a/specs/guard-jwt.spec/pom.xml b/specs/guard-jwt.spec/pom.xml index 81c2f9a24c..24421889a0 100644 --- a/specs/guard-jwt.spec/pom.xml +++ b/specs/guard-jwt.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.98 0 diff --git a/specs/guard-jwt.spec/src/main/resources/META-INF/zilla/jwt.idl b/specs/guard-jwt.spec/src/main/resources/META-INF/zilla/jwt.idl index 937f7f2cf7..81049bbab9 100644 --- a/specs/guard-jwt.spec/src/main/resources/META-INF/zilla/jwt.idl +++ b/specs/guard-jwt.spec/src/main/resources/META-INF/zilla/jwt.idl @@ -24,6 +24,7 @@ scope jwt struct JwtAuthorizationFailedEx extends core::stream::Extension { string8 identity; + string16 reason; } union JwtEventEx switch (JwtEventType) diff --git a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml index 4b85ea2070..e70027751e 100644 --- a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml +++ b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: guard.jwt.authorization.failed - message: AUTHORIZATION_FAILED user + name: GUARD_JWT_AUTHORIZATION_FAILED + message: JWT token authorization failed for identity (user). Token is expired. guards: jwt0: type: jwt diff --git a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/guard-keys-dynamic.yaml b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/guard-keys-dynamic.yaml index f877141e5b..d4663cd0f9 100644 --- a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/guard-keys-dynamic.yaml +++ b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/guard-keys-dynamic.yaml @@ -13,20 +13,13 @@ # specific language governing permissions and limitations under the License. # -{ - "name": "test", - "guards": - { - "jwt0": - { - "type": "jwt", - "options": - { - "issuer": "https://aklivity.us.auth0.com", - "audience": "https://api.aklivity.com", - "keys": "https://aklivity.us.auth0.com/.well-known/jwks.json", - "challenge": 30 - } - } - } -} +--- +name: test +guards: + jwt0: + type: jwt + options: + issuer: http://localhost:8080 + audience: https://api.aklivity.com + keys: http://localhost:8080/.well-known/jwks.json + challenge: 30 diff --git a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/guard-keys-implicit.yaml b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/guard-keys-implicit.yaml index 8994c3c306..138928094f 100644 --- a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/guard-keys-implicit.yaml +++ b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/guard-keys-implicit.yaml @@ -19,6 +19,6 @@ guards: jwt0: type: jwt options: - issuer: https://aklivity.us.auth0.com + issuer: http://localhost:8080 audience: https://api.aklivity.com challenge: 30 diff --git a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/keys/issuer.rpt b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/keys/issuer.rpt new file mode 100644 index 0000000000..7be87bde1e --- /dev/null +++ b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/keys/issuer.rpt @@ -0,0 +1,29 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "http://localhost:8080/.well-known/jwks.json" + + +accepted +connected + +read http:method "GET" +read closed + +write http:status "200" "OK" +write http:content-length +write '{}' + +write close diff --git a/specs/metrics-grpc.spec/pom.xml b/specs/metrics-grpc.spec/pom.xml index 6beb93b810..c29302a4a6 100644 --- a/specs/metrics-grpc.spec/pom.xml +++ b/specs/metrics-grpc.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -110,7 +108,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/metrics-http.spec/pom.xml b/specs/metrics-http.spec/pom.xml index 961f6fdd63..cfc5debc2a 100644 --- a/specs/metrics-http.spec/pom.xml +++ b/specs/metrics-http.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -52,8 +50,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -115,7 +113,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/metrics-stream.spec/pom.xml b/specs/metrics-stream.spec/pom.xml index e00ec43149..fc450d5f84 100644 --- a/specs/metrics-stream.spec/pom.xml +++ b/specs/metrics-stream.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -110,7 +108,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/model-avro.spec/pom.xml b/specs/model-avro.spec/pom.xml index 2b929788eb..160857be4d 100644 --- a/specs/model-avro.spec/pom.xml +++ b/specs/model-avro.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -110,7 +108,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml b/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml index 2f90087d02..56cb116f69 100644 --- a/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml +++ b/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: model.avro.validation.failed - message: VALIDATION_FAILED java.io.EOFException + name: MODEL_AVRO_VALIDATION_FAILED + message: A message payload failed validation. java.io.EOFException. catalogs: test0: type: test diff --git a/specs/model-core.spec/pom.xml b/specs/model-core.spec/pom.xml index 79fb07babd..7fdc29503e 100644 --- a/specs/model-core.spec/pom.xml +++ b/specs/model-core.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,16 +24,14 @@ - 11 - 11 1.00 0 - org.kaazing - k3po.lang + io.aklivity.k3po + lang provided @@ -47,8 +45,8 @@ test - org.kaazing - k3po.junit + io.aklivity.k3po + control-junit test @@ -110,7 +108,7 @@ moditect-maven-plugin - org.kaazing + io.aklivity.k3po k3po-maven-plugin diff --git a/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml b/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml index 0eb313abbe..049ad1f8da 100644 --- a/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml +++ b/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: model.core.validation.failed - message: VALIDATION_FAILED string + name: MODEL_CORE_VALIDATION_FAILED + message: A message payload failed validation. A field was not the expected type (string). bindings: net0: kind: server diff --git a/specs/model-json.spec/NOTICE b/specs/model-json.spec/NOTICE index ed4c502c75..fa9b8adebc 100644 --- a/specs/model-json.spec/NOTICE +++ b/specs/model-json.spec/NOTICE @@ -16,8 +16,7 @@ This project includes: Jakarta JSON Processing API under Eclipse Public License 2.0 or GNU General Public License, version 2 with the GNU Classpath Exception Java Unified Expression Language API under The Apache Software License, Version 2.0 Java Unified Expression Language Implementation under The Apache Software License, Version 2.0 - k3po/lang under The Apache Software License, Version 2.0 - Kaazing Corporation License under The Apache Software License, Version 2.0 + k3po::runtime::lang under The Apache Software License, Version 2.0 org.leadpony.justify under The Apache Software License, Version 2.0 zilla::specs::engine.spec under The Apache Software License, Version 2.0 diff --git a/specs/model-json.spec/pom.xml b/specs/model-json.spec/pom.xml index 212f994903..a62aab28c4 100644 --- a/specs/model-json.spec/pom.xml +++ b/specs/model-json.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.98 0 diff --git a/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml b/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml index af289dce90..92b2894c51 100644 --- a/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml +++ b/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: model.json.validation.failed - message: VALIDATION_FAILED [1,10][/id] The value must be of string type, but actual type is integer. + name: MODEL_JSON_VALIDATION_FAILED + message: A message payload failed validation. [1,10][/id] The value must be of string type, but actual type is integer. catalogs: test0: type: test diff --git a/specs/model-protobuf.spec/NOTICE b/specs/model-protobuf.spec/NOTICE index ed4c502c75..fa9b8adebc 100644 --- a/specs/model-protobuf.spec/NOTICE +++ b/specs/model-protobuf.spec/NOTICE @@ -16,8 +16,7 @@ This project includes: Jakarta JSON Processing API under Eclipse Public License 2.0 or GNU General Public License, version 2 with the GNU Classpath Exception Java Unified Expression Language API under The Apache Software License, Version 2.0 Java Unified Expression Language Implementation under The Apache Software License, Version 2.0 - k3po/lang under The Apache Software License, Version 2.0 - Kaazing Corporation License under The Apache Software License, Version 2.0 + k3po::runtime::lang under The Apache Software License, Version 2.0 org.leadpony.justify under The Apache Software License, Version 2.0 zilla::specs::engine.spec under The Apache Software License, Version 2.0 diff --git a/specs/model-protobuf.spec/pom.xml b/specs/model-protobuf.spec/pom.xml index d8525e3455..784b7a947e 100644 --- a/specs/model-protobuf.spec/pom.xml +++ b/specs/model-protobuf.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 0.98 0 diff --git a/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml b/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml index 2aa546c91b..8eb83d4407 100644 --- a/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml +++ b/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: model.protobuf.validation.failed - message: "VALIDATION_FAILED Cannot find field: date in message example" + name: MODEL_PROTOBUF_VALIDATION_FAILED + message: "A message payload failed validation. Cannot find field: date in message example." catalogs: test0: type: test diff --git a/specs/pom.xml b/specs/pom.xml index e541df0eb3..1b71f0f35b 100644 --- a/specs/pom.xml +++ b/specs/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla zilla - 0.9.82 + 0.9.83 ../pom.xml @@ -40,11 +40,13 @@ binding-sse-kafka.spec binding-kafka-grpc.spec catalog-apicurio.spec + catalog-filesystem.spec catalog-inline.spec catalog-karapace.spec exporter-otlp.spec exporter-prometheus.spec exporter-stdout.spec + filesystem-http.spec metrics-stream.spec metrics-http.spec metrics-grpc.spec diff --git a/specs/vault-filesystem.spec/NOTICE b/specs/vault-filesystem.spec/NOTICE index 3bc6a69e5c..5888335337 100644 --- a/specs/vault-filesystem.spec/NOTICE +++ b/specs/vault-filesystem.spec/NOTICE @@ -18,8 +18,7 @@ This project includes: Jakarta JSON Processing API under Eclipse Public License 2.0 or GNU General Public License, version 2 with the GNU Classpath Exception Java Unified Expression Language API under The Apache Software License, Version 2.0 Java Unified Expression Language Implementation under The Apache Software License, Version 2.0 - k3po/lang under The Apache Software License, Version 2.0 - Kaazing Corporation License under The Apache Software License, Version 2.0 + k3po::runtime::lang under The Apache Software License, Version 2.0 org.leadpony.justify under The Apache Software License, Version 2.0 zilla::specs::engine.spec under The Apache Software License, Version 2.0 diff --git a/specs/vault-filesystem.spec/pom.xml b/specs/vault-filesystem.spec/pom.xml index f31e388f15..74dfae61e2 100644 --- a/specs/vault-filesystem.spec/pom.xml +++ b/specs/vault-filesystem.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - 0.9.82 + 0.9.83 ../pom.xml @@ -24,8 +24,6 @@ - 11 - 11 1.00 0