Skip to content

Pedrolustosa/Rabbit.Publisher.Api

Repository files navigation

RabbitMQ Study Project

License GitHub issues GitHub stars Views

This is a simple project created for studying the RabbitMQ functionality using the C# language and .NET 6.

Project Structure

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.

Dependencies

Configuration and Usage

  1. Clone the Repository:

    git clone https://github.com/Pedrolustosa/Rabbit.Publisher.Api.git
  2. Install Docker and RabbitMQ:

    • Make sure you have Docker installed on your machine.
    • Pull the RabbitMQ Docker image:
    docker pull rabbitmq
  3. 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.

  4. RabbitMQ Configuration:

    • Update the RabbitMQ connection settings in the code as needed to match your Docker container.
  5. Run the Project:

    • Open the project in Visual Studio or use .NET CLI commands to run the project.
    cd Rabbit.Publisher.Api
    dotnet run
  6. Test the API:

    • Use tools like Postman to send requests to the API and observe the sending of RabbitMQ messages.

Contributions

Contributions are welcome! Feel free to open issues or send pull requests.

License

This project is licensed under the MIT License.