This is a simple project created for studying the RabbitMQ functionality using the C# language and .NET 6.
The project is organized into different modules to facilitate understanding and maintenance. Here's an overview of the structure:
- Rabbit.Consumer: Module responsible for consuming messages from RabbitMQ.
- Rabbit.Models: Definition of data models (entities) used in the project.
- Rabbit.Publisher.Api: API responsible for publishing messages to RabbitMQ.
- Rabbit.Repositories: Interfaces and implementations of repositories for storing or retrieving data related to RabbitMQ messages.
- Rabbit.Service: Interfaces and implementations of services for processing or handling RabbitMQ messages.
-
Clone the Repository:
git clone https://github.com/Pedrolustosa/Rabbit.Publisher.Api.git
-
Install Docker and RabbitMQ:
- Make sure you have Docker installed on your machine.
- Pull the RabbitMQ Docker image:
docker pull rabbitmq
-
Run RabbitMQ Container:
- Start a RabbitMQ container with the following command:
docker run -d --name rabbitmq-container -p 5672:5672 -p 15672:15672 rabbitmq
This will run RabbitMQ on port 5672 and expose the management interface on port 15672.
-
RabbitMQ Configuration:
- Update the RabbitMQ connection settings in the code as needed to match your Docker container.
-
Run the Project:
- Open the project in Visual Studio or use .NET CLI commands to run the project.
cd Rabbit.Publisher.Api dotnet run
-
Test the API:
- Use tools like Postman to send requests to the API and observe the sending of RabbitMQ messages.
Contributions are welcome! Feel free to open issues or send pull requests.
This project is licensed under the MIT License.