aklivity / zilla

🦎 A multi-protocol edge & service proxy. Seamlessly interface web apps, IoT clients, & microservices to Apache Kafka® via declaratively defined, stateless APIs.
https://docs.aklivity.io/zilla
Other
511 stars 48 forks source link

AsyncAPI sse kafka filtering support #1137

Closed akrambek closed 5 days ago

akrambek commented 1 week ago

Add support for sse-kafka filtering.

For example.

      - when:
          - path: /payment-requests
        exit: kafka_cache_client1808eec1-480a-4f24-af7d-3a99101cc5b3
        with:
          event:
            id: '["${base64(key)}","${etag}"]'
          topic: payment-requests
          filters:
            - headers:
                zilla:identity: ${guarded['jwt3dc23de6-5185-46f8-86f7-717c3b023d8a'].identity}
jfallows commented 1 week ago

@akrambek Perhaps we need to indicate this intent via the AsyncAPI spec, then honor it during config generation?

jfallows commented 6 days ago

For example, in AsyncAPI operation bindings.

bindings:
  x-zilla-sse-kafka:
    filters:
      headers:
        zilla:identity: {identity}

generates

      - when:
          - path: /payment-requests
        exit: kafka_cache_client0
        with:
          event:
            id: '["${base64(key)}","${etag}"]'
          topic: payment-requests
          filters:
            - headers:
                zilla:identity: ${guarded[<guard-name>].identity}