From c68bb94fd4f83a640592b67363da9d0521d62045 Mon Sep 17 00:00:00 2001 From: henil Date: Sat, 3 Dec 2022 20:18:22 +0530 Subject: [PATCH 1/7] initial commit --- README.md | 130 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 120 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 329754d7a..53376ad70 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,140 @@ -

- +
rumqtt Logo - -

- +
build status - Discord chat + Discord chat

+## What is rumqtt? + rumqtt is an opensource set of libraries written in rust-lang to implement the MQTT standard while striving to be simple, robust and performant. -- [![crates.io page](https://img.shields.io/crates/v/rumqttc.svg)](https://crates.io/crates/rumqttc) [![docs.rs page](https://docs.rs/rumqttc/badge.svg)](https://docs.rs/rumqttc) [**rumqttc:**](./rumqttc/) A high level, easy to use mqtt client -- [![crates.io page](https://img.shields.io/crates/v/rumqttd.svg)](https://crates.io/crates/rumqttd) [![docs.rs page](https://docs.rs/rumqttd/badge.svg)](https://docs.rs/rumqttd) [**rumqttd:**](./rumqttd/) A high performance, embeddable MQTT broker +| Crate | Description | version | +| -- | -- | -- | +| [rumqttc](./rumqttc/)| A high level, easy to use mqtt client | [![crates.io page](https://img.shields.io/crates/v/rumqttc.svg)](https://crates.io/crates/rumqttc) | +| [rumqttd](./rumqttd/) | A high performance, embeddable MQTT broker |[![crates.io page](https://img.shields.io/crates/v/rumqttd.svg)](https://crates.io/crates/rumqttd) | + + +# Contents + +- [Installation and Usage](#installation-and-usage) + - [rumqttd](#rumqttd) + - [Compile from source](#compile-from-source) + - [Install using cargo](#install-using-cargo) + - [Run using Docker](#run-using-docker) + - [rumqttc](#rumqttc) +- [Features](#features) + - [rumqttd](#rumqttd) + - [rumqttc](#rumqttc) +- [Contributing](#contributing) +- [License](#license) > NOTE: MQTTv5 implementation of both client and broker are WIP, so currently only MQTTv311 is supported. -## Contributing +# Installation and Usage + +## rumqttd + +### Compile from source + +Clone the repo using git clone. + +``` +git clone --depth=1 https://github.com/bytebeamio/rumqtt/ +``` + +Change directory to that folder and run + +``` +cd rumqtt +cargo run --bin rumqttd -- -c rumqttd/demo.toml -vvv +``` + +### Install using cargo + +``` +cargo install --git https://github.com/bytebeamio/rumqtt rumqttd +``` + +and run using + +``` +rumqttd --config demo.toml +``` + +Note: Make sure to you correct demo.toml file for a specific version of rumqttd + + +### Run using docker + +rumqttd can be used with docker by pulling the image from docker hub as follows: +```bash +docker pull bytebeamio/rumqttd +``` + +To use the rumqttd docker image with the included `demo.toml` while exposing the necessary ports for clients to interact with the broker, use the following command: +```bash +docker run -p 1883:1883 -p 1884:1884 -it bytebeamio/rumqttd -c demo.toml +``` + +One can also mount the local directory containing configs as a volume and use the appropriate config file as follows: +```bash +docker run -v /path/to/configs:/configs -p 1883:1883 -it bytebeamio/rumqttd -c /configs/config.toml +``` + +for more information look at rumqttd's [README](https://github.com/bytebeamio/rumqtt/blob/main/rumqttd/README.md) + +## rumqttc + +Add rumqttc to your project using + +``` +cargo add rumqttc --all-features +``` + +for more information look at rumqttc's [README](https://github.com/bytebeamio/rumqtt/blob/main/rumqttc/README.md) + + +# Features + +## rumqttd + +#### Currently supported features + +- MQTT 3.1.1 +- QoS 0 and 1 +- Retained messages +- Connection via TLS +- Last will +- All MQTT 3.1.1 packets + +#### Future scope + +- QoS 2 +- Retransmission after reconnect +- MQTT 5 + + +## rumqttc + +#### Currently supported features + +- MQTT 3.1.1 + +### Future scope + +- MQTT 5 client + +# Contributing Please follow the [code of conduct](docs/CoC.md) while opening issues to report bugs or before you contribute fixes, also do read our [contributor guide](CONTRIBUTING.md) to get a better idea of what we'd appreciate and what we won't. -## License +# License This project is released under The Apache License, Version 2.0 ([LICENSE](./LICENSE) or http://www.apache.org/licenses/LICENSE-2.0) From b0eeea1945d0aab3139fe65d3de3479a15262d71 Mon Sep 17 00:00:00 2001 From: henil Date: Sun, 4 Dec 2022 16:56:10 +0530 Subject: [PATCH 2/7] move around sections --- README.md | 117 ++++++++++++++++++++++++---------------------- rumqttd/README.md | 33 ------------- 2 files changed, 62 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index 53376ad70..1592bf4ba 100644 --- a/README.md +++ b/README.md @@ -23,46 +23,55 @@ rumqtt is an opensource set of libraries written in rust-lang to implement the M # Contents -- [Installation and Usage](#installation-and-usage) - - [rumqttd](#rumqttd) - - [Compile from source](#compile-from-source) - - [Install using cargo](#install-using-cargo) - - [Run using Docker](#run-using-docker) - - [rumqttc](#rumqttc) -- [Features](#features) - - [rumqttd](#rumqttd) - - [rumqttc](#rumqttc) -- [Contributing](#contributing) -- [License](#license) - -> NOTE: MQTTv5 implementation of both client and broker are WIP, so currently only MQTTv311 is supported. +* [Installation and Usage](#installation-and-usage) + * [rumqttd](#rumqttd) + * [Run using docker](#run-using-docker) + * [Install using cargo](#install-using-cargo) + * [Compile from source](#compile-from-source) + * [rumqttc](#rumqttc) +* [Features](#features) + * [rumqttd](#rumqttd-1) + * [rumqttc](#rumqttc-1) +* [Community](#community) +* [Contributing](#contributing) +* [License](#license) # Installation and Usage ## rumqttd -### Compile from source +### Run using docker -Clone the repo using git clone. +rumqttd can be used with docker by pulling the image from docker hub as follows: +```bash +docker pull bytebeamio/rumqttd +``` +To use the rumqttd docker image with the included `demo.toml` while exposing the necessary ports for clients to interact with the broker, use the following command: +```bash +docker run -p 1883:1883 -p 1884:1884 -it bytebeamio/rumqttd -c demo.toml ``` -git clone --depth=1 https://github.com/bytebeamio/rumqtt/ + +One can also mount the local directory containing configs as a volume and use the appropriate config file as follows: +```bash +docker run -v /path/to/configs:/configs -p 1883:1883 -it bytebeamio/rumqttd -c /configs/config.toml ``` -Change directory to that folder and run +
+ +### Install using cargo ``` -cd rumqtt -cargo run --bin rumqttd -- -c rumqttd/demo.toml -vvv +cargo install --git https://github.com/bytebeamio/rumqtt rumqttd ``` -### Install using cargo +download the demo config file ``` -cargo install --git https://github.com/bytebeamio/rumqtt rumqttd +curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/bytebeamio/rumqtt/main/rumqttd/demo.toml > demo.toml ``` -and run using +and run the broker using ``` rumqttd --config demo.toml @@ -70,23 +79,24 @@ rumqttd --config demo.toml Note: Make sure to you correct demo.toml file for a specific version of rumqttd +
-### Run using docker +### Compile from source -rumqttd can be used with docker by pulling the image from docker hub as follows: -```bash -docker pull bytebeamio/rumqttd -``` +Clone the repo using git clone. -To use the rumqttd docker image with the included `demo.toml` while exposing the necessary ports for clients to interact with the broker, use the following command: -```bash -docker run -p 1883:1883 -p 1884:1884 -it bytebeamio/rumqttd -c demo.toml +``` +git clone --depth=1 https://github.com/bytebeamio/rumqtt/ ``` -One can also mount the local directory containing configs as a volume and use the appropriate config file as follows: -```bash -docker run -v /path/to/configs:/configs -p 1883:1883 -it bytebeamio/rumqttd -c /configs/config.toml +Change directory to that folder and run + ``` +cd rumqtt +cargo run --release --bin rumqttd -- -c rumqttd/demo.toml -vvv +``` + +
for more information look at rumqttd's [README](https://github.com/bytebeamio/rumqtt/blob/main/rumqttd/README.md) @@ -98,38 +108,36 @@ Add rumqttc to your project using cargo add rumqttc --all-features ``` +
+ for more information look at rumqttc's [README](https://github.com/bytebeamio/rumqtt/blob/main/rumqttc/README.md) # Features -## rumqttd +## rumqttd -#### Currently supported features +- [x] MQTT 3.1.1 +- [x] QoS 0 and 1 +- [x] Retained messages +- [x] Connection via TLS +- [x] Last will +- [ ] Retransmission after reconnect +- [ ] QoS 2 +- [ ] MQTT 5 -- MQTT 3.1.1 -- QoS 0 and 1 -- Retained messages -- Connection via TLS -- Last will -- All MQTT 3.1.1 packets -#### Future scope +# rumqttc -- QoS 2 -- Retransmission after reconnect -- MQTT 5 +- [x] MQTT 3.1.1 +- [ ] MQTT 5 +# Community -## rumqttc - -#### Currently supported features - -- MQTT 3.1.1 - -### Future scope - -- MQTT 5 client +- Follow us on [Twitter](https://twitter.com/bytebeamhq) +- Connect with us on [LinkedIn](https://www.linkedin.com/company/bytebeam/) +- Chat with us on [Discord](https://discord.gg/mpkSqDg) +- Read our official [Blog](https://bytebeam.io/blog/) # Contributing Please follow the [code of conduct](docs/CoC.md) while opening issues to report bugs or before you contribute fixes, also do read our [contributor guide](CONTRIBUTING.md) to get a better idea of what we'd appreciate and what we won't. @@ -137,4 +145,3 @@ Please follow the [code of conduct](docs/CoC.md) while opening issues to report # License This project is released under The Apache License, Version 2.0 ([LICENSE](./LICENSE) or http://www.apache.org/licenses/LICENSE-2.0) - diff --git a/rumqttd/README.md b/rumqttd/README.md index 7eb4d0a6b..aef2706b7 100644 --- a/rumqttd/README.md +++ b/rumqttd/README.md @@ -6,22 +6,6 @@ Rumqttd is a high performance MQTT broker written in Rust. It's light weight and embeddable, meaning you can use it as a library in your code and extend functionality -## Currently supported features - -- MQTT 3.1.1 -- QoS 0 and 1 -- Retained messages -- Connection via TLS -- Last will -- All MQTT 3.1.1 packets - -## Upcoming features - -- QoS 2 -- Retransmission after reconnect -- MQTT 5 - - ## Getting started You can directly run the broker by running the binary with a config file with: @@ -34,23 +18,6 @@ cargo run --release -- -c demo.toml Example config file is provided on the root of the repo. -### Using Docker - -rumqttd can be used with docker by pulling the image from docker hub as follows: -```bash -docker pull bytebeamio/rumqttd -``` - -To use the rumqttd docker image with the included `demo.toml` while exposing the necessary ports for clients to interact with the broker, use the following command: -```bash -docker run -p 1883:1883 -p 1884:1884 -it bytebeamio/rumqttd -c demo.toml -``` - -One can also mount the local directory containing configs as a volume and use the appropriate config file as follows: -```bash -docker run -v /path/to/configs:/configs -p 1883:1883 -it bytebeamio/rumqttd -c /configs/config.toml -``` - #### Building the docker image In order to run rumqttd within a docker container, build the image by running `build_rumqttd_docker.sh` from the project's root directory. The shell script will use docker to build rumqttd and package it along in an [alpine](https://hub.docker.com/_/alpine) image. You can then run `rumqttd` with the included `demo.toml` as follows(ensure you are in the project's root directory): From 62f83c91217c83bcf197f0019174d4b9be5cb629 Mon Sep 17 00:00:00 2001 From: Mrinal Paliwal Date: Sun, 4 Dec 2022 18:53:38 +0530 Subject: [PATCH 3/7] fix: Update discord badge in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1592bf4ba..d82f42929 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ build status - Discord chat + Discord chat
From 762cf0aa504880aaaff6b27cacc4e928ad6d05c1 Mon Sep 17 00:00:00 2001 From: henil Date: Mon, 5 Dec 2022 12:20:32 +0530 Subject: [PATCH 4/7] rename demo.toml to rumqttd.toml --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d82f42929..d44a46acf 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,9 @@ rumqttd can be used with docker by pulling the image from docker hub as follows: docker pull bytebeamio/rumqttd ``` -To use the rumqttd docker image with the included `demo.toml` while exposing the necessary ports for clients to interact with the broker, use the following command: +To use the rumqttd docker image with the included `rumqttd.toml` while exposing the necessary ports for clients to interact with the broker, use the following command: ```bash -docker run -p 1883:1883 -p 1884:1884 -it bytebeamio/rumqttd -c demo.toml +docker run -p 1883:1883 -p 1884:1884 -it bytebeamio/rumqttd -c rumqttd.toml ``` One can also mount the local directory containing configs as a volume and use the appropriate config file as follows: @@ -68,16 +68,16 @@ cargo install --git https://github.com/bytebeamio/rumqtt rumqttd download the demo config file ``` -curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/bytebeamio/rumqtt/main/rumqttd/demo.toml > demo.toml +curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/bytebeamio/rumqtt/main/rumqttd/rumqttd.toml > rumqttd.toml ``` and run the broker using ``` -rumqttd --config demo.toml +rumqttd --config rumqttd.toml ``` -Note: Make sure to you correct demo.toml file for a specific version of rumqttd +Note: Make sure to you correct rumqttd.toml file for a specific version of rumqttd
@@ -93,7 +93,7 @@ Change directory to that folder and run ``` cd rumqtt -cargo run --release --bin rumqttd -- -c rumqttd/demo.toml -vvv +cargo run --release --bin rumqttd -- -c rumqttd/rumqttd.toml -vvv ```
From bfcaeacdbec85c1873aa2998165cfb2f7701d23e Mon Sep 17 00:00:00 2001 From: henil Date: Mon, 5 Dec 2022 12:29:37 +0530 Subject: [PATCH 5/7] change file name and update dockerfile to reflect those changes --- Dockerfile | 2 +- rumqttd/{demo.toml => rumqttd.toml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename rumqttd/{demo.toml => rumqttd.toml} (100%) diff --git a/Dockerfile b/Dockerfile index 074ff07cb..65c9c5ba4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,6 @@ RUN cargo build --release -p rumqttd FROM alpine:latest COPY --from=builder /usr/src/rumqtt/target/release/rumqttd /usr/local/bin/rumqttd -COPY ./rumqttd/demo.toml . +COPY ./rumqttd/rumqttd.toml . ENV RUST_LOG="info" ENTRYPOINT ["rumqttd"] diff --git a/rumqttd/demo.toml b/rumqttd/rumqttd.toml similarity index 100% rename from rumqttd/demo.toml rename to rumqttd/rumqttd.toml From abd7b1de80b7e5f2061aa4ea293deb8c18875334 Mon Sep 17 00:00:00 2001 From: henil Date: Tue, 6 Dec 2022 11:35:54 +0530 Subject: [PATCH 6/7] rename demo.toml to rumqttd.toml in main.rs --- rumqttd/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rumqttd/src/main.rs b/rumqttd/src/main.rs index 260c274a3..c6d245b7d 100644 --- a/rumqttd/src/main.rs +++ b/rumqttd/src/main.rs @@ -5,7 +5,7 @@ use rumqttd::Broker; use structopt::StructOpt; -pub static RUMQTTD_DEFAULT_CONFIG: &str = include_str!("../demo.toml"); +pub static RUMQTTD_DEFAULT_CONFIG: &str = include_str!("../rumqttd.toml"); #[derive(StructOpt)] #[structopt(name = "rumqttd")] From b59e3f9fb4c5fb810fa37e35deb7c603adb59c03 Mon Sep 17 00:00:00 2001 From: henil Date: Tue, 6 Dec 2022 11:49:54 +0530 Subject: [PATCH 7/7] Add section for prebuilt binaries with link to our releases page --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index d44a46acf..6a680ac92 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ rumqtt is an opensource set of libraries written in rust-lang to implement the M * [Installation and Usage](#installation-and-usage) * [rumqttd](#rumqttd) * [Run using docker](#run-using-docker) + * [Prebuild binaries](#prebuilt-binaries) * [Install using cargo](#install-using-cargo) * [Compile from source](#compile-from-source) * [rumqttc](#rumqttc) @@ -59,6 +60,12 @@ docker run -v /path/to/configs:/configs -p 1883:1883 -it bytebeamio/rumqttd -c /
+### Prebuilt binaries + +For prebuilt binaries checkout our [releases](https://github.com/bytebeamio/rumqtt/releases), download suitable binary for your system and move it to any directory in your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)). + +
+ ### Install using cargo ```