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/README.md b/README.md index 329754d7a..6a680ac92 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@ -

- +
rumqtt Logo - -

- +
build status @@ -14,17 +11,144 @@

+## 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) + * [Run using docker](#run-using-docker) + * [Prebuild binaries](#prebuilt-binaries) + * [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 + +### 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 `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 rumqttd.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 +``` + +
+ +### 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 + +``` +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/rumqttd.toml > rumqttd.toml +``` + +and run the broker using + +``` +rumqttd --config rumqttd.toml +``` -> NOTE: MQTTv5 implementation of both client and broker are WIP, so currently only MQTTv311 is supported. +Note: Make sure to you correct rumqttd.toml file for a specific version of rumqttd -## Contributing +
+ +### 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 --release --bin rumqttd -- -c rumqttd/rumqttd.toml -vvv +``` + +
+ +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 + +- [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 + + +# rumqttc + +- [x] MQTT 3.1.1 +- [ ] MQTT 5 + +# Community + +- 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. -## License +# 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): diff --git a/rumqttd/demo.toml b/rumqttd/rumqttd.toml similarity index 100% rename from rumqttd/demo.toml rename to rumqttd/rumqttd.toml 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")]