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
528 stars 48 forks source link

syntax check mqtt topic names and topic filters in zilla.yaml #521

Open vordimous opened 11 months ago

vordimous commented 11 months ago

Is your feature request related to a problem? Please describe. When I use an invalid topic name/filter Zilla will crash with a stack trace Caused by: java.util.regex.PatternSyntaxException: Dangling meta character '*'

    - when:
        - publish:
            - topic: "*"
        - subscribe:
            - topic: "*"

Describe the solution you'd like Add validation checks when parsing the zilla.yaml

jfallows commented 11 months ago

Topic filter wildcard syntax in mqtt uses + and #.

We should definitely enforce this in zilla.yaml schema for both mqtt and mqtt-kafka bindings, to get a more reasonable error message on startup when the syntax is incorrect.