Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 112 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ amqprs = { version = "2", features = ["traces"] }
config = { version = "0.14", default-features = false, features = ["yaml"] } # TODO check to see why this can't be upgraded to v15
deadpool-amqprs = "0.3"
futures = "0.3"
rumqttc = "0.24.0"
secrecy = { version = "0.10", features = ["serde"] }
serde = { version = "1", features = ["derive"] }
serde-aux = "4"
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Caveats:
- while you can have a `client` and a `server` application for both systems, you should only have one of the clients talk to the other's server. Don't connect both clients to both servers.


Currently only supports AMQP 0-9-1 as the broker protocol but can potentially support others in the future
Currently only supports AMQP 0-9-1 and MQTT 3-1-1 as the broker protocols, but can potentially support others in the future

## Why Rust?

Expand Down Expand Up @@ -84,15 +84,18 @@ Specific configuration structs are in `proxy-http-server/src/configuration.rs` a

## Setup

### Using the RabbitMQ web management UIs
### Using the RabbitMQ web management UIs (AMQP)

These instructions assume you are using the docker compose configuration and the default `conf.yaml` configurations for each.

1) Make sure that you run `docker compose up -d` from the root directory, to start both brokers and their associated management UIs.
2) Make sure that you have both applications started (do NOT start more than 1 of each). Each application should be connected to a separate broker.
3) To login to the broker that the server instance uses, go to localhost:15672, username `intersect_username`, password `intersect_password`
4) To login to the broker that the client instance uses, go to localhost:15673, username `intersect_username`, password `intersect_password`
5) On each application, click on the `Exchanges` tab, and click on the `intersect-messages` exchange.
5)
- IF AMQP: On each application, click on the `Exchanges` tab, and click on the `intersect-messages` exchange.
- IF MQTT: On each application, click on the `Queues and Streams` tab, then click on the queue (it should look like `mqtt-subscription-proxy-http-clientqos1` or `mqtt-subscription-proxy-http-serverqos1`).

6) Make sure that the `Publish message` dropdown is expanded, select the large text area which is labeled with `Payload:`

For the application on `localhost:15672`, set the payload to below (no newlines):
Expand Down Expand Up @@ -145,3 +148,7 @@ Now it's advisable to [run some INTERSECT-SDK examples](https://github.com/INTER
- one exchange for all messages for each application (see `shared-deps/src/protocols/amqp/mod.rs` to get name)
- routing keys will match SDK naming schematics (SOS hierarchy, "." as separator, end with ".{userspace|lifecycle|events}"). The routing key will roughly correspond to the `destination` field in an INTERSECT message, but the `destination` field only exists on userspace messages (event/lifecycle messages do not have a specific destination in mind).
- The queue name is hardcoded to match the name of the application.

## MQTT setup

- follows similar rationale to AMQP, except does not utilize exchanges.
2 changes: 1 addition & 1 deletion charts/proxy-http-client/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: proxy-http-client
description: "Subscribe to events over HTTP from a proxy-http-server instance, and publish them on a local broker"
version: 0.1.1
version: 0.1.2
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
Expand Down
2 changes: 2 additions & 0 deletions charts/proxy-http-client/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ spec:
value: {{ .Values.app.broker.host | quote }}
- name: PROXYAPP_BROKER__PORT
value: {{ .Values.app.broker.port | quote }}
- name: PROXYAPP_BROKER__PROTOCOL
value: {{ .Values.app.broker.protocol | quote }}
- name: PROXYAPP_OTHER_PROXY__URL
value: {{ .Values.app.other_proxy.url | quote }}
- name: PROXYAPP_OTHER_PROXY__USERNAME
Expand Down
1 change: 1 addition & 0 deletions charts/proxy-http-client/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ app:
broker:
host: "127.0.0.1"
port: "5672"
protocol: "amqp" # or "mqtt"
username: ""
password:
isSecret: false
Expand Down
2 changes: 1 addition & 1 deletion charts/proxy-http-server/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: proxy-http-server
description: "Subscribe to broker messages and broadcast them to HTTP listeners"
version: 0.1.1
version: 0.1.2
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
Expand Down
2 changes: 2 additions & 0 deletions charts/proxy-http-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ spec:
value: {{ .Values.app.broker.port | quote }}
- name: PROXYAPP_APP_PORT
value: {{ .Values.containerPort | quote }}
- name: PROXYAPP_BROKER__PROTOCOL
value: {{ .Values.app.broker.protocol | quote }}
- name: PROXYAPP_TOPIC_PREFIX
value: {{ required "app.topic_prefix not set (i.e. 'organization.facility.system.')" .Values.app.topic_prefix | quote }}
- name: PROXYAPP_USERNAME
Expand Down
1 change: 1 addition & 0 deletions charts/proxy-http-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ app:
broker:
host: "127.0.0.1"
port: "5672"
protocol: "amqp" # or "mqtt"
username: ""
password:
isSecret: false
Expand Down
4 changes: 2 additions & 2 deletions proxy-http-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "proxy-http-client"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
publish = false
default-run = "proxy-http-client"
Expand All @@ -15,8 +15,8 @@ name = "proxy-http-client"
[dependencies]
anyhow = { workspace = true }
async-stream = { workspace = true }
deadpool-amqprs = { workspace = true }
futures = { workspace = true }
rumqttc = { workspace = true }
secrecy = { workspace = true }
serde = { workspace = true }
serde-aux = { workspace = true }
Expand Down
Loading