You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.3 KiB
Markdown

6 years ago
Testing three different MQTT brokers: mosquitto, hbmqtt (python) and volantmq (go).
6 years ago
The goal is to compare different brokers using the same client code.
In particular, I wanted to know if the main python and golang broker implementations support QOS level 2 subscriptions.
i.e. whether the broker will store undelivered messages while the subscriber is offline, and deliver them once it comes online.
6 years ago
The compose file sets up the three brokers, and two clients (a producer and a consumer).
## Setup
6 years ago
Before you launch the clients, launch the brokers you want to try with compose.
This will launch the three brokers:
6 years ago
```
docker-compose up mosquitto pybroker gobroker
```
6 years ago
## Clients
The clients can be configured to use different brokers with the `MQTT_HOST` environment variable (see below).
You can run as many clients as you wish.
### Mosquitto
6 years ago
```
docker-compose run -e MQTT_HOST=mosquitto consumer
```
```
docker-compose run -e MQTT_HOST=mosquitto producer
```
6 years ago
### HBMQTT (python)
6 years ago
This broker is using BoltDB (an embedded key-value store) for persistence.
```
docker-compose run -e MQTT_HOST=pybroker consumer
```
```
docker-compose run -e MQTT_HOST=pybroker producer
```
6 years ago
### VolantMQ (Go)
6 years ago
```
docker-compose run -e MQTT_HOST=gobroker consumer
```
```
docker-compose run -e MQTT_HOST=gobroker producer
```