1 unstable release
0.1.5 | Feb 12, 2025 |
---|---|
0.1.4 |
|
#720 in Network programming
656 downloads per month
19KB
124 lines
RabbitMQ Service
================
A library to accelerate RabbitMQ deployment and management.
Overview
This library provides a simple and efficient way to interact with RabbitMQ, allowing you to focus on your application's logic without worrying about the underlying messaging infrastructure.
Features
- Establishes a connection to a RabbitMQ server at the specified URI
- Registers two queues, one for requests and one for responses, using the given queue name with "_requests" and "_responses" suffixes, respectively
- Sends and receives messages to/from the queues
- Closes the RabbitMQ connection, attempting to take ownership of the connection
Usage
Creating a new RabbitMQService instance
let service = RabbitMQService::new("amqp://admin:admin123@localhost:5672", "test_queue").await?;
Sending a message to the request queue
service.send_request("test_queue", "Hello, RabbitMQ!").await?;
Receiving a message from the response queue
let result: Option<String> = service.receive_response("test_queue").await?;
Closing the RabbitMQ connection
service.close().await?;
Testing
This library includes a set of tests to ensure its functionality. You can run the tests using the following command:
cargo test
Dependencies
rabbit_mqr
= "0.1.10"serde
= "1.0.217"serde_json
= "1.0.137"thiserror
= "2.0.11"uuid
= { version = "1.12.1", features = ["serde","v4"] }
License
This library is licensed under the Apache-2.0 license.
Contributing
Contributions are welcome! If you'd like to contribute to this library, please fork the repository and submit a pull request.
Authors
- Femure maxime.femery@gmail.com
Dependencies
~9–23MB
~298K SLoC