Crates.io | metalmq |
lib.rs | metalmq |
version | 0.3.0 |
source | src |
created_at | 2021-02-02 17:33:50.144972 |
updated_at | 2023-02-12 13:02:01.009458 |
description | MetalMQ server |
homepage | |
repository | https://github.com/jonasrichard/metalmq |
max_upload_size | |
id | 349838 |
size | 226,060 |
metalmq
is under development, it is not feature complete but you can try and run with cargo run.
cargo run --bin metalmq
## or to enable logs
RUST_LOG=debug cargo run --bin metalmq
RUST_LOG=metalmq=trace cargo run --bin metalmq
cargo test --tests
## or to run integration tests
cargo test --package metalmq --test it
There are some examples in the examples
directory, they implement simple scenarios of the
metalmq-client
library. To run execute
RUST_LOG=metalmq_client=trace cargo run --example publish-consume
Running tests in metalmq-client
cargo test --package metalmq-client --test it
For AMQP compliance we use pika
Python library and pytest
framework to be to validate
the comformance of metalmq server.
cd amqp-compliance
pytest
Method | Field |
---|---|
connection. | |
channel. | |
exchange.declare | :white_check_mark: exchange |
:x: type | |
:white_check_mark: passive | |
:x: durable (no persistence) | |
:question: arguments | |
queue.declare | :white_check_mark: queue |
:white_check_mark: passive | |
:question: durable | |
:white_check_mark: exclusive | |
:white_check_mark: auto-delete | |
basic. |
In metalmq-client
there is a Rust async client which implements part of the AMQP 0.9.1 protocol.
You can try agains metalmq
server or rabbitmq
.
#docker run -p 5672:5672 -p 15672:15672 --rm rabbitmq:3-management
cargo test --lib metalmq-client
In order to validate AMQP packages we also need a stable AMQP client implementation which is
the pika
. It runs on Python, so one need to install pipenv
to run that.
cd amqp-compliance
pytest
Switch on logging in the beginning of the test.
#[tokio::test]
async fn test() -> Result<()> {
env_logger::builder().is_test(true).try_init();
}
Start the test with the environment variable set.
RUST_LOG=metalmq_client=trace cargo test -- --exact exchange::declare_exchange_with_different_type --show-output
Run unit test with coverage.
rustup component add llvm-tools-preview
cargo install grconv
mkdir -p target/coverage/data
make metalmq-cover
open target/coverage/html/index.html
In the examples the publish-consume test has dependency on the tokio console.
RUSTFLAGS="--cfg tokio_unstable" cargo run --example publish-consume