Skip to content

Commit 4a6fd28

Browse files
committed
Merge remote-tracking branch 'origin/main' into add-compose-for-full
2 parents 47fb542 + 597c063 commit 4a6fd28

40 files changed

+1268
-473
lines changed

Cargo.lock

Lines changed: 112 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ amqprs = { version = "2", features = ["traces"] }
1212
config = { version = "0.14", default-features = false, features = ["yaml"] } # TODO check to see why this can't be upgraded to v15
1313
deadpool-amqprs = "0.3"
1414
futures = "0.3"
15+
rumqttc = "0.24.0"
1516
secrecy = { version = "0.10", features = ["serde"] }
1617
serde = { version = "1", features = ["derive"] }
1718
serde-aux = "4"

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Caveats:
5656
- 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.
5757

5858

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

6161
## Why Rust?
6262

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

8585
## Setup
8686

87-
### Using the RabbitMQ web management UIs
87+
### Using the RabbitMQ web management UIs (AMQP)
8888

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

9191
1) Make sure that you run `docker compose up -d` from the root directory, to start both brokers and their associated management UIs.
9292
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.
9393
3) To login to the broker that the server instance uses, go to localhost:15672, username `intersect_username`, password `intersect_password`
9494
4) To login to the broker that the client instance uses, go to localhost:15673, username `intersect_username`, password `intersect_password`
95-
5) On each application, click on the `Exchanges` tab, and click on the `intersect-messages` exchange.
95+
5)
96+
- IF AMQP: On each application, click on the `Exchanges` tab, and click on the `intersect-messages` exchange.
97+
- 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`).
98+
9699
6) Make sure that the `Publish message` dropdown is expanded, select the large text area which is labeled with `Payload:`
97100

98101
For the application on `localhost:15672`, set the payload to below (no newlines):
@@ -145,3 +148,7 @@ Now it's advisable to [run some INTERSECT-SDK examples](https://github.com/INTER
145148
- one exchange for all messages for each application (see `shared-deps/src/protocols/amqp/mod.rs` to get name)
146149
- 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).
147150
- The queue name is hardcoded to match the name of the application.
151+
152+
## MQTT setup
153+
154+
- follows similar rationale to AMQP, except does not utilize exchanges.

charts/proxy-http-client/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: proxy-http-client
33
description: "Subscribe to events over HTTP from a proxy-http-server instance, and publish them on a local broker"
4-
version: 0.1.1
4+
version: 0.1.2
55
dependencies:
66
- name: common
77
repository: oci://registry-1.docker.io/bitnamicharts

charts/proxy-http-client/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ spec:
107107
value: {{ .Values.app.broker.host | quote }}
108108
- name: PROXYAPP_BROKER__PORT
109109
value: {{ .Values.app.broker.port | quote }}
110+
- name: PROXYAPP_BROKER__PROTOCOL
111+
value: {{ .Values.app.broker.protocol | quote }}
110112
- name: PROXYAPP_OTHER_PROXY__URL
111113
value: {{ .Values.app.other_proxy.url | quote }}
112114
- name: PROXYAPP_OTHER_PROXY__USERNAME

charts/proxy-http-client/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ app:
136136
broker:
137137
host: "127.0.0.1"
138138
port: "5672"
139+
protocol: "amqp" # or "mqtt"
139140
username: ""
140141
password:
141142
isSecret: false

charts/proxy-http-server/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: proxy-http-server
33
description: "Subscribe to broker messages and broadcast them to HTTP listeners"
4-
version: 0.1.1
4+
version: 0.1.2
55
dependencies:
66
- name: common
77
repository: oci://registry-1.docker.io/bitnamicharts

charts/proxy-http-server/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ spec:
112112
value: {{ .Values.app.broker.port | quote }}
113113
- name: PROXYAPP_APP_PORT
114114
value: {{ .Values.containerPort | quote }}
115+
- name: PROXYAPP_BROKER__PROTOCOL
116+
value: {{ .Values.app.broker.protocol | quote }}
115117
- name: PROXYAPP_TOPIC_PREFIX
116118
value: {{ required "app.topic_prefix not set (i.e. 'organization.facility.system.')" .Values.app.topic_prefix | quote }}
117119
- name: PROXYAPP_USERNAME

charts/proxy-http-server/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ app:
166166
broker:
167167
host: "127.0.0.1"
168168
port: "5672"
169+
protocol: "amqp" # or "mqtt"
169170
username: ""
170171
password:
171172
isSecret: false

proxy-http-client/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "proxy-http-client"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
edition = "2021"
55
publish = false
66
default-run = "proxy-http-client"
@@ -15,8 +15,8 @@ name = "proxy-http-client"
1515
[dependencies]
1616
anyhow = { workspace = true }
1717
async-stream = { workspace = true }
18-
deadpool-amqprs = { workspace = true }
1918
futures = { workspace = true }
19+
rumqttc = { workspace = true }
2020
secrecy = { workspace = true }
2121
serde = { workspace = true }
2222
serde-aux = { workspace = true }

0 commit comments

Comments
 (0)