# 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
```rust
let service = RabbitMQService::new("amqp://admin:admin123@localhost:5672", "test_queue").await?;
```
### Sending a message to the request queue
```rust
service.send_request("Hello, RabbitMQ!").await?;
```
### Receiving a message from the request queue
```rust
let result: Option<String> = service.receive_request().await?;
```
### Closing the RabbitMQ connection
```rust
service.close().await?;
```
## Testing
--------
This library includes a set of tests to ensure its functionality. You can run the tests using the following command:
```bash
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>