From 3834ca89705cb1b26a054ef0b4b53fc4dcb5c820 Mon Sep 17 00:00:00 2001 From: AJ Date: Wed, 20 Sep 2023 17:19:49 -0400 Subject: [PATCH] update route exit yaml example --- src/reference/config/bindings/binding-amqp.md | 5 +- .../config/bindings/binding-grpc-kafka.md | 5 +- src/reference/config/bindings/binding-grpc.md | 5 +- .../bindings/binding-http-filesystem.md | 5 +- .../config/bindings/binding-http-kafka.md | 5 +- src/reference/config/bindings/binding-http.md | 5 +- .../config/bindings/binding-kafka-grpc.md | 5 +- .../config/bindings/binding-mqtt-kafka.md | 40 +++++++++----- src/reference/config/bindings/binding-mqtt.md | 55 ++++++++++++++----- .../config/bindings/binding-proxy.md | 5 +- .../config/bindings/binding-sse-kafka.md | 5 +- src/reference/config/bindings/binding-sse.md | 5 +- src/reference/config/bindings/binding-tcp.md | 7 +++ src/reference/config/bindings/binding-tls.md | 5 +- src/reference/config/bindings/binding-ws.md | 5 +- 15 files changed, 123 insertions(+), 39 deletions(-) diff --git a/src/reference/config/bindings/binding-amqp.md b/src/reference/config/bindings/binding-amqp.md index a24a3959..e8e37df3 100644 --- a/src/reference/config/bindings/binding-amqp.md +++ b/src/reference/config/bindings/binding-amqp.md @@ -122,7 +122,10 @@ Defaults to `"send_and_receive"`. Next binding when following this route. ```yaml -exit: echo_server +routes: + - when: + ... + exit: echo_server ``` --- diff --git a/src/reference/config/bindings/binding-grpc-kafka.md b/src/reference/config/bindings/binding-grpc-kafka.md index 57ab90f1..cc30a900 100644 --- a/src/reference/config/bindings/binding-grpc-kafka.md +++ b/src/reference/config/bindings/binding-grpc-kafka.md @@ -300,7 +300,10 @@ Base64 encoded value for binary metadata header. Next binding when following this route. ```yaml -exit: kafka_cache_client +routes: + - when: + ... + exit: kafka_cache_client ``` ### routes[].with\* diff --git a/src/reference/config/bindings/binding-grpc.md b/src/reference/config/bindings/binding-grpc.md index 733c6c4b..5d26a91e 100644 --- a/src/reference/config/bindings/binding-grpc.md +++ b/src/reference/config/bindings/binding-grpc.md @@ -173,7 +173,10 @@ Base64 encoded value for binary metadata header. Routed exit binding when conditional route matches. ```yaml -exit: echo_server +routes: + - when: + ... + exit: echo_server ``` --- diff --git a/src/reference/config/bindings/binding-http-filesystem.md b/src/reference/config/bindings/binding-http-filesystem.md index 332f10c8..2f13b16d 100644 --- a/src/reference/config/bindings/binding-http-filesystem.md +++ b/src/reference/config/bindings/binding-http-filesystem.md @@ -124,7 +124,10 @@ Path with optional embedded parameter names, such as `/{path}`. Next binding when following this route. ```yaml -exit: filesystem_server +routes: + - when: + ... + exit: filesystem_server ``` ### routes[].with diff --git a/src/reference/config/bindings/binding-http-kafka.md b/src/reference/config/bindings/binding-http-kafka.md index 1b07f295..da99612f 100644 --- a/src/reference/config/bindings/binding-http-kafka.md +++ b/src/reference/config/bindings/binding-http-kafka.md @@ -264,7 +264,10 @@ Path with optional embedded parameter names, such as `/{topic}`. Default exit binding when no conditional routes are viable. ```yaml -exit: kafka_cache_client +routes: + - when: + ... + exit: kafka_cache_client ``` ### routes[].with diff --git a/src/reference/config/bindings/binding-http.md b/src/reference/config/bindings/binding-http.md index 82d1d690..305b077e 100644 --- a/src/reference/config/bindings/binding-http.md +++ b/src/reference/config/bindings/binding-http.md @@ -314,7 +314,10 @@ Header name value pairs (all match). Next binding when following this route. ```yaml -exit: echo_server +routes: + - when: + ... + exit: echo_server ``` --- diff --git a/src/reference/config/bindings/binding-kafka-grpc.md b/src/reference/config/bindings/binding-kafka-grpc.md index 9826bea1..88495728 100644 --- a/src/reference/config/bindings/binding-kafka-grpc.md +++ b/src/reference/config/bindings/binding-kafka-grpc.md @@ -238,7 +238,10 @@ Pattern matching the fully qualified name of a `grpc` service method, in the for Default exit binding when no conditional routes are viable. ```yaml -exit: kafka_cache_client +routes: + - when: + ... + exit: kafka_cache_client ``` ### routes[].with diff --git a/src/reference/config/bindings/binding-mqtt-kafka.md b/src/reference/config/bindings/binding-mqtt-kafka.md index a5cbbdef..e7a4eb52 100644 --- a/src/reference/config/bindings/binding-mqtt-kafka.md +++ b/src/reference/config/bindings/binding-mqtt-kafka.md @@ -34,6 +34,11 @@ Defines a binding with `mqtt-kafka` support, with `proxy` behavior. - [kind\*](#kind) - [options](#options) + - [options.server](#options-server) + - [options.topics](#options-topics) + - [topics.sessions\*](#topics-sessions) + - [topics.messages\*](#topics-messages) + - [topics.retained\*](#topics-retained) - [exit](#exit) ::: right @@ -54,37 +59,46 @@ Behave as a `mqtt-kafka` `proxy`. `mqtt-kafka`-specific options for configuring the `kafka` topics that the proxy will use to route mqtt messages and session states; and define server reference of the MQTT server in Zilla +#### options.server + +> `string` + +The server reference used by the MQTT server in Zilla. This config enables scaling of the MQTT server when running multiple Zilla instances as it uses [server redirection](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901255). + ```yaml options: server: mqtt-1.example.com:1883 - topics: - sessions: mqtt-sessions - messages: mqtt-messages - retained: mqtt-retained ``` -#### options.server +#### options.topics > `object` -The server reference used by the MQTT server in Zilla. This config enables scaling of the MQTT server when running multiple Zilla instances as it uses server redirection. -(TODO: how much should we explain here? Or a different section? https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901255) +The `kafka` topics Zilla needs when routing MQTT messages + +```yaml +options: + topics: + sessions: mqtt-sessions + messages: mqtt-messages + retained: mqtt-retained +``` -#### options.topics.sessions +##### topics.sessions\* -> `object` +> `string` Compacted Kafka topic for storing mqtt session states. -#### options.topics.messages +##### topics.messages\* -> `object` +> `string` Kafka topic used for routing mqtt messages. -#### options.topics.retained +##### topics.retained\* -> `object` +> `string` Compacted Kafka topic for storing mqtt retained messages. diff --git a/src/reference/config/bindings/binding-mqtt.md b/src/reference/config/bindings/binding-mqtt.md index 28919ed4..1caa4f80 100644 --- a/src/reference/config/bindings/binding-mqtt.md +++ b/src/reference/config/bindings/binding-mqtt.md @@ -24,8 +24,7 @@ mqtt_server: - topic: command/two - subscribe: - topic: reply - exit: mqtt_kafka_proxy1 - exit: mqtt_kafka_proxy0 + exit: mqtt_kafka_proxy ``` ## Summary @@ -45,8 +44,12 @@ Conditional routes based on the `topic` `name` are used to route these applicati - [routes](#routes) - [routes\[\].guarded](#routes-guarded) - [routes\[\].when](#routes-when) - - [when\[\].topic\*](#when-topic) - - [when\[\].capabilities](#when-capabilities) + - [when\[\].session](#when-session) + - [session.client-id](#session-client-id) + - [when\[\].publish](#when-publish) + - [publish.topic](#publish-topic) + - [when\[\].subscribe](#when-subscribe) + - [subscribe.topic](#subscribe-topic) - [routes\[\].exit\*](#routes-exit) ::: right @@ -99,34 +102,55 @@ List of conditions (any match) to match this route. ```yaml routes: - when: + # any required - session: - client-id: "*" - publish: - topic: command/one - - topic: command/two - subscribe: - topic: reply - exit: mqtt_kafka_proxy1 + - when: + # all required + - session: + - client-id: "*" + publish: + - topic: command/two + subscribe: + - topic: reply ``` -#### when[].session[] +#### when[].session -> `array` +> `array` of `object` + +Array of mqtt session properties -Array of client identifiers, allowing the usage of wildcards. +##### session.client-id -#### when[].publish[] +> `string` -> `array` +An MQTT client identifier, allowing the usage of wildcards. + +#### when[].publish + +> `array` of `object` Array of MQTT topic names for publish capability. -#### when[].subscribe[] +##### publish.topic + +> `string` -> `array` +#### when[].subscribe + +> `array` of `object` Array of MQTT topic names for subscribe capability. +##### subscribe.topic + +> `string` + ### routes[].exit\* @@ -135,7 +159,10 @@ Array of MQTT topic names for subscribe capability. Next binding when following this route. ```yaml -exit: mqtt_kafka_proxy +routes: + - when: + ... + exit: mqtt_kafka_proxy ``` --- diff --git a/src/reference/config/bindings/binding-proxy.md b/src/reference/config/bindings/binding-proxy.md index c5b35526..c20cd689 100644 --- a/src/reference/config/bindings/binding-proxy.md +++ b/src/reference/config/bindings/binding-proxy.md @@ -166,7 +166,10 @@ Port number. Next binding when following this route. ```yaml -exit: echo_server +routes: + - when: + ... + exit: echo_server ``` --- diff --git a/src/reference/config/bindings/binding-sse-kafka.md b/src/reference/config/bindings/binding-sse-kafka.md index ddb31b51..b0e9d293 100644 --- a/src/reference/config/bindings/binding-sse-kafka.md +++ b/src/reference/config/bindings/binding-sse-kafka.md @@ -136,7 +136,10 @@ Path with optional embedded parameter names, such as `/{topic}`. Next binding when following this route. ```yaml -exit: kafka_cache_client +routes: + - when: + ... + exit: kafka_cache_client ``` ### routes[].with diff --git a/src/reference/config/bindings/binding-sse.md b/src/reference/config/bindings/binding-sse.md index 9e4823d4..351fa810 100644 --- a/src/reference/config/bindings/binding-sse.md +++ b/src/reference/config/bindings/binding-sse.md @@ -134,7 +134,10 @@ Path pattern. Next binding when following this route. ```yaml -exit: sse_kafka_proxy +routes: + - when: + ... + exit: sse_kafka_proxy ``` --- diff --git a/src/reference/config/bindings/binding-tcp.md b/src/reference/config/bindings/binding-tcp.md index f6bfa3de..24c771af 100644 --- a/src/reference/config/bindings/binding-tcp.md +++ b/src/reference/config/bindings/binding-tcp.md @@ -136,6 +136,13 @@ Port number(s), including port number ranges. Next binding when following this route, for kind `server` only. +```yaml +routes: + - when: + ... + exit: echo_server +``` + --- ::: right diff --git a/src/reference/config/bindings/binding-tls.md b/src/reference/config/bindings/binding-tls.md index 22d91985..ffe5af45 100644 --- a/src/reference/config/bindings/binding-tls.md +++ b/src/reference/config/bindings/binding-tls.md @@ -228,7 +228,10 @@ Application protocol. Next binding when following this route. ```yaml -exit: echo_server +routes: + - when: + ... + exit: echo_server ``` --- diff --git a/src/reference/config/bindings/binding-ws.md b/src/reference/config/bindings/binding-ws.md index 98b7d26f..2cfb9887 100644 --- a/src/reference/config/bindings/binding-ws.md +++ b/src/reference/config/bindings/binding-ws.md @@ -185,7 +185,10 @@ Path pattern. Next binding when following this route. ```yaml -exit: echo_server +routes: + - when: + ... + exit: echo_server ``` ---