Skip to content

Commit

Permalink
update route exit yaml example
Browse files Browse the repository at this point in the history
  • Loading branch information
vordimous committed Sep 20, 2023
1 parent 259b8be commit 3834ca8
Show file tree
Hide file tree
Showing 15 changed files with 123 additions and 39 deletions.
5 changes: 4 additions & 1 deletion src/reference/config/bindings/binding-amqp.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ Defaults to `"send_and_receive"`.
Next binding when following this route.

```yaml
exit: echo_server
routes:
- when:
...
exit: echo_server
```

---
Expand Down
5 changes: 4 additions & 1 deletion src/reference/config/bindings/binding-grpc-kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -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\*
Expand Down
5 changes: 4 additions & 1 deletion src/reference/config/bindings/binding-grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

---
Expand Down
5 changes: 4 additions & 1 deletion src/reference/config/bindings/binding-http-filesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/reference/config/bindings/binding-http-kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/reference/config/bindings/binding-http.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

---
Expand Down
5 changes: 4 additions & 1 deletion src/reference/config/bindings/binding-kafka-grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 27 additions & 13 deletions src/reference/config/bindings/binding-mqtt-kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down
55 changes: 41 additions & 14 deletions src/reference/config/bindings/binding-mqtt.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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\*

Expand All @@ -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
```

---
Expand Down
5 changes: 4 additions & 1 deletion src/reference/config/bindings/binding-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ Port number.
Next binding when following this route.

```yaml
exit: echo_server
routes:
- when:
...
exit: echo_server
```

---
Expand Down
5 changes: 4 additions & 1 deletion src/reference/config/bindings/binding-sse-kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/reference/config/bindings/binding-sse.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ Path pattern.
Next binding when following this route.

```yaml
exit: sse_kafka_proxy
routes:
- when:
...
exit: sse_kafka_proxy
```

---
Expand Down
7 changes: 7 additions & 0 deletions src/reference/config/bindings/binding-tcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/reference/config/bindings/binding-tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ Application protocol.
Next binding when following this route.

```yaml
exit: echo_server
routes:
- when:
...
exit: echo_server
```

---
Expand Down
5 changes: 4 additions & 1 deletion src/reference/config/bindings/binding-ws.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ Path pattern.
Next binding when following this route.

```yaml
exit: echo_server
routes:
- when:
...
exit: echo_server
```

---
Expand Down

0 comments on commit 3834ca8

Please sign in to comment.