SDLE First Assignment of group T06G14.
Reliable PUB-SUB messaging library for RUST. Provides Broker implementation and functions to use in clients and publishers.
The project is structured in three sub-projects. A library called meic_mq. A client that has some test scenarios and the broker.
Dependencies Rust
We recommend installing Rust by following the official guide that can be found here. Addicionally our project depends on ZeroMQ because our library is actually a binding to the C implementation and on pkg-config. We only tested our program under Ubuntu and Ubuntu under WSL2.
ZeroMQ can be installed with the following command:
apt install libzmq3-dev
pkg-config can be installed with the following command:
apt install pkg-config
Our program uses the Cargo as package manager and build system
The following commands assume the user is inside the broker folder.
The broker can be compiled with the following command:
cargo build
The broker can be ran with the following command (that also compiles the program):
cargo run
The following commands assume the user is inside the client folder.
The client can be compiled with the following command:
cargo build
The client has three test scenarios. One called slow subscriber that tries to emulate the scenario where a subscriber is behind other subscriber and the broker needs to wait for the slowest one to be able to delete messages. The second one is called late subscriber and tries to replicate the scenario where a subscriber subscribes a topic when a topic already has messages. The last one is called concurrency and tries to emulate concurent reads on multiple topics. This scenario is divided in four parts: cars publisher, biology publisher, cars subscriber and biology subscriber. Each publisher and subscriber try to send request with a 500 millisecond interval so that we can maximize concurrency between get and put requests.
cargo run -- slow_sub
cargo run -- late_sub
cargo run -- conc_pub_bio [publisher id]
cargo run -- conc_pub_cars [publisher id]
cargo run -- conc_sub_bio [subscriber id]
cargo run -- conc_sub_cars [subscriber id]
Group members:
- Marcelo Couto up201906086@up.pt
- Francisco Oliveira up201907361@up.pt
- Miguel Amorim up201907756@up.pt
- André Santos up201907879@up.pt