Skip to content

Commit

Permalink
update readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
vordimous committed Oct 22, 2024
1 parent 70fac06 commit b78d41b
Show file tree
Hide file tree
Showing 41 changed files with 486 additions and 1,386 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ This repo contains a collection of [example folders](#examples) that can be used

## Prerequisites

[![Docker]][docker-install][![Kubernetes]][kubernetes-install][![Kafka]][kafka-install][![Postman]][postman-url]
[![Docker]][docker-install][![Postman]][postman-url]

You will need an environment with [Docker][docker-install] or [Helm][helm-install] and [Kubernetes][kubernetes-install] installed. Check out our [Postman collections][postman-url] for more ways to interact with an example.
You will need an environment with [Docker][docker-install] installed. Check out our [Postman collections][postman-url] for more ways to interact with an example.

## Getting Started

Expand Down Expand Up @@ -106,13 +106,8 @@ Join the [Slack community][community-join].
[community-image]: https://img.shields.io/badge/slack-@aklivitycommunity-blue.svg?logo=slack
[community-join]: https://join.slack.com/t/aklivitycommunity/shared_invite/zt-sy06wvr9-u6cPmBNQplX5wVfd9l2oIQ
[Docker]: https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white
[Kubernetes]: https://img.shields.io/badge/kubernetes-%23326ce5.svg?style=for-the-badge&logo=kubernetes&logoColor=white
[Kafka]: https://img.shields.io/badge/Apache%20Kafka-000?style=for-the-badge&logo=apachekafka
[Postman]: https://img.shields.io/badge/Postman-FF6C37?style=for-the-badge&logo=postman&logoColor=white
[zilla-docs]: https://docs.aklivity.io/zilla
[zilla-examples]: https://github.com/aklivity/zilla-examples
[docker-install]: https://docs.docker.com/compose/gettingstarted/
[helm-install]: https://helm.sh/docs/intro/install/
[kubernetes-install]: https://kubernetes.io/docs/tasks/tools/
[kafka-install]: https://kafka.apache.org/
[postman-url]: https://www.postman.com/aklivity-zilla/
51 changes: 13 additions & 38 deletions amqp.reflect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,24 @@
Listens on amqp port `7172` and will echo back whatever is sent to the server, broadcasting to all receiving clients.
Listens on amqps port `7171` and will echo back whatever is sent to the server, broadcasting to all receiving clients.

### Requirements
## Requirements

- bash, jq, nc
- Kubernetes (e.g. Docker Desktop with Kubernetes enabled)
- kubectl
- helm 3.0+
- jq, nc
- Compose compatible host
- cli-rhea

### Setup
## Setup

The `setup.sh` script:

- installs Zilla to the Kubernetes cluster with helm and waits for the pod to start up
- starts port forwarding
The `setup.sh` script will install the Open Source Zilla image in a Compose stack along with any necessary services defined in the [compose.yaml](compose.yaml) file.

```bash
./setup.sh
```

output:
- alternatively with the docker compose command:

```text
+ ZILLA_CHART=oci://ghcr.io/aklivity/charts/zilla
+ helm upgrade --install zilla-amqp-reflect oci://ghcr.io/aklivity/charts/zilla --namespace zilla-amqp-reflect --create-namespace --wait [...]
NAME: zilla-amqp-reflect
LAST DEPLOYED: [...]
NAMESPACE: zilla-amqp-reflect
STATUS: deployed
REVISION: 1
NOTES:
Zilla has been installed.
[...]
+ nc -z localhost 7171
+ kubectl port-forward --namespace zilla-amqp-reflect service/zilla 7171 7172
+ sleep 1
+ nc -z localhost 7171
Connection to localhost port 7171 [tcp/*] succeeded!
```bash
docker compose up -d
```

### Install amqp client
Expand Down Expand Up @@ -157,22 +138,16 @@ output:
rhea:events [efd09fe2-4090-4141-91e6-5ce5223d1dbc] Container got event: sendable +0ms
```

### Teardown
## Teardown

The `teardown.sh` script stops port forwarding, uninstalls Zilla and deletes the namespace.
The `teardown.sh` script will remove any resources created.

```bash
./teardown.sh
```

output:
- alternatively with the docker compose command:

```text
+ pgrep kubectl
99999
+ killall kubectl
+ helm uninstall zilla-amqp-echo --namespace zilla-amqp-echo
release "zilla-amqp-echo" uninstalled
+ kubectl delete namespace zilla-amqp-echo
namespace "zilla-amqp-echo" deleted
```bash
docker compose down --remove-orphans
```
17 changes: 11 additions & 6 deletions asyncapi.http.kafka.proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ In this guide, you create Kafka topics and use Zilla to implement the common Pet

## Setup

The `setup.sh` script will:
The `setup.sh` script will install the Open Source Zilla image in a Compose stack along with any necessary services defined in the [compose.yaml](compose.yaml) file.

- create the necessary kafka topics
- create the Petstore API at `http://localhost:7114`

```bash
./setup.sh
```

- alternatively with the docker compose command:

```bash
docker compose up -d
```

### Using this example

#### Synchronous APIs
Expand Down Expand Up @@ -156,15 +161,15 @@ output:
Using `kcat` and the copied `correlation-id` produce the correlated message:

```sh
echo '{"id":200000,"username":"fehguy","status":"approved","address":[{"street":"437 Lytton","city":"Palo Alto","state":"CA","zip":"94301"}]}' | \
kcat -P \
-b localhost:29092 \
echo '{"id":200000,"username":"fehguy","status":"approved","address":[{"street":"437 Lytton","city":"Palo Alto","state":"CA","zip":"94301"}]}' | docker compose -p zilla-asyncapi-http-kafka-proxy exec -T kcat \
kafkacat -P \
-b kafka:29092 \
-k "c234d09b-2fdf-4538-9d31-27c8e2912d4e" \
-t petstore-verified-customers \
-H "zilla:correlation-id={correlationId}"
```

### Teardown
## Teardown

The `teardown.sh` script will remove any resources created.

Expand Down
11 changes: 8 additions & 3 deletions asyncapi.mqtt.kafka.proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ Zilla implements MQTT API defined in AsyncAPI specifications and uses Kafka API

## Setup

The `setup.sh` script will:
The `setup.sh` script will install the Open Source Zilla image in a Compose stack along with any necessary services defined in the [compose.yaml](compose.yaml) file.

- create the necessary kafka topics
- create an MQTT broker at `mqtt://localhost:7183`

```bash
./setup.sh
```

- alternatively with the docker compose command:

```bash
docker compose up -d
```

### Using this example

Using eclipse-mosquitto subscribe to the `smartylighting/streetlights/1/0/event/+/lighting/measured` topic.
Expand Down Expand Up @@ -64,7 +69,7 @@ Received DISCONNECT (153)
Error: The client is not currently connected.
```

### Teardown
## Teardown

The `teardown.sh` script will remove any resources created.

Expand Down
70 changes: 10 additions & 60 deletions asyncapi.mqtt.proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,24 @@

Listens on mqtt port `7183` and will forward mqtt publish messages and proxies subscribes to mosquitto MQTT broker listening on `1883` for topic `smartylighting/streetlights/1/0/event/+/lighting/measured`.

### Requirements
## Requirements

- bash, jq, nc
- Kubernetes (e.g. Docker Desktop with Kubernetes enabled)
- kubectl
- helm 3.0+
- jq, nc
- Compose compatible host
- mosquitto
- kcat

### Setup
## Setup

The `setup.sh` script:

- installs Zilla to the Kubernetes cluster with helm and waits for the pod to start up
- installs mosquitto MQTT broker to the Kubernetes cluster with helm and waits for the pod to start up
- starts port forwarding
The `setup.sh` script will install the Open Source Zilla image in a Compose stack along with any necessary services defined in the [compose.yaml](compose.yaml) file.

```bash
./setup.sh
```

```text
+ ZILLA_CHART=oci://ghcr.io/aklivity/charts/zilla
+ helm upgrade --install asyncapi-mqtt-proxy oci://ghcr.io/aklivity/charts/zilla --namespace asyncapi-mqtt-proxy --create-namespace --wait --values values.yaml --set-file 'zilla\.yaml=zilla.yaml'
NAME: asyncapi-mqtt-proxy
LAST DEPLOYED: [...]
NAMESPACE: asyncapi-mqtt-proxy
STATUS: deployed
REVISION: 1
NOTES:
Zilla has been installed.
+ helm upgrade --install zilla-mqtt-kafka-reflect-kafka chart --namespace zilla-mqtt-kafka-reflect --create-namespace --wait
NAME: zilla-mqtt-kafka-reflect-kafka
LAST DEPLOYED: [...]
NAMESPACE: zilla-mqtt-kafka-reflect
STATUS: deployed
REVISION: 1
TEST SUITE: None
+ helm upgrade --install asyncapi-mqtt-proxy-mosquitto chart --namespace asyncapi-mqtt-proxy --create-namespace --wait
NAME: asyncapi-mqtt-proxy-mosquitto
LAST DEPLOYED: Tue Sep 19 18:15:07 2023
NAMESPACE: asyncapi-mqtt-proxy
STATUS: deployed
REVISION: 1
TEST SUITE: None
+ kubectl port-forward --namespace asyncapi-mqtt-proxy service/asyncapi-mqtt-proxy-zilla 7183
+ nc -z localhost 7183
+ kubectl port-forward --namespace asyncapi-mqtt-proxy service/mosquitto 1883
+ sleep 1
+ nc -z localhost 7183
Connection to localhost port 7183 [tcp/ibm-mqisdp] succeeded!
+ nc -z localhost 1883
Connection to localhost port 1883 [tcp/idmaps] succeeded!
- alternatively with the docker compose command:

```bash
docker compose up -d
```

### Install mqtt client
Expand Down Expand Up @@ -115,25 +79,11 @@ Error: The client is not currently connected.

Note that the invalid message is rejected with error code `153` `payload format invalid`, and therefore not received by the subscriber.

### Teardown
## Teardown

The `teardown.sh` script stops port forwarding, uninstalls Zilla and mosquitto broker and deletes the namespace.
The `teardown.sh` script stops the compose stack.

```bash
./teardown.sh

```

output:

```text
+ + pgrep kubectl
99998
99999
+ killall kubectl
+ helm uninstall asyncapi-mqtt-proxy asyncapi-mqtt-proxy-mosquitto --namespace asyncapi-mqtt-proxy
release "asyncapi-mqtt-proxy" uninstalled
release "asyncapi-mqtt-proxy-mosquitto" uninstalled
+ kubectl delete namespace asyncapi-mqtt-proxy
namespace "asyncapi-mqtt-proxy" deleted
```
19 changes: 12 additions & 7 deletions asyncapi.sse.kafka.proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ Zilla is implementing the SSE endpoints defined in an AsyncAPI 3.x spec and prox

## Setup

The `setup.sh` script will:
The `setup.sh` script will install the Open Source Zilla image in a Compose stack along with any necessary services defined in the [compose.yaml](compose.yaml) file.

- create the necessary kafka topics
- create the Eventstore API at `http://localhost:7114`

```bash
./setup.sh
```

- alternatively with the docker compose command:

```bash
docker compose up -d
```

### Verify behaviour

Using `curl` client connect to the SSE stream.
Expand Down Expand Up @@ -45,15 +50,15 @@ data:{ "id": 1, "name": "Hello World!"}

In another terminal window use `kcat` to publish to the `events` Kafka topic
```bash
echo '{ "id": 1, "name": "Hello World!"}' | \
kcat -P \
-b localhost:29092 \
-k "1" -t events
echo '{ "id": 1, "name": "Hello World!"}' | docker compose -p zilla-asyncapi-sse-kafka-proxy exec -T kcat \
kafkacat -P \
-b kafka:29092 \
-k "1" -t events
```

On the `curl` client, the event should appear.

### Teardown
## Teardown

The `teardown.sh` script will remove any resources created.

Expand Down
Loading

0 comments on commit b78d41b

Please sign in to comment.