Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp readme #532

Merged
merged 8 commits into from Dec 11, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -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"]
146 changes: 135 additions & 11 deletions README.md
@@ -1,9 +1,6 @@
<h1 align="center">
<a href="https://bytebeamio.github.io/rumqtt">
<div align="center">
<img alt="rumqtt Logo" src="docs/rumqtt.png" width="60%" />
</a>
</h1>

</div>
<div align="center">
<a href="https://github.com/bytebeamio/rumqtt/actions/workflows/build.yml">
<img alt="build status" src="https://github.com/bytebeamio/rumqtt/actions/workflows/build.yml/badge.svg">
Expand All @@ -14,17 +11,144 @@
</div>
<br/>

## 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
```

<br/>

### 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)).

<br/>

### 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
<br/>

### 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
```

<br/>

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
```

<br/>

for more information look at rumqttc's [README](https://github.com/bytebeamio/rumqtt/blob/main/rumqttc/README.md)


# Features

## <a id="rumqttd-1"></a> 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


# <a id="rumqttc-1"></a> 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)

33 changes: 0 additions & 33 deletions rumqttd/README.md
Expand Up @@ -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:
Expand All @@ -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):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion rumqttd/src/main.rs
Expand Up @@ -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")]
Expand Down