This is a demo project showcasing a message queue service implementation using RabbitMQ and .NET 4.7.
The project demonstrates the following features:
- Two channels: Channel A and Channel B.
- Two message publishers for each channel.
- Two or more consumers for each channel.
- Two consumers shared between both channels.
-
Clone the repository:
git clone https://github.com/emrul11/OSL-MessageQueueService
-
Open the solution in Visual Studio.
-
Configure RabbitMQ:
- Install RabbitMQ. In command line run this command. - docker run --hostname rabbit --name rabbit-server -p 15672:15672 -p 5672:5672 rabbitmq:3.12.12-management
- Update RabbitMQ connection details in the project as needed. (MessageQueueService/Infrastructure/Connections/RabbitMQConnection.cs)
-
Build and Run the Solution:
- Build the solution in Visual Studio.
- Run the application.
- MessageQueueService.ShowConsumedMessage: View consumed messages.
- MessageQueueService.Common: Shared models and common utilities.
- MessageQueueService.Infrastructure.Connections: Connection setup for RabbitMQ.
- MessageQueueService.Publisher: Message publishers for Channel A and Channel B.
- MessageQueueService.Consumer: Consumers for Channel A and Channel B.
- MessageQueueService.Web: Web project containing controllers, views, and application setup.
- Open the web application in your browser.
- Use the provided UI to publish messages to Channel A and Channel B.
- Run the MessageQueueService.ShowConsumedMessage to see consumed messages both from channel A and B
- Make sure RabbitMQ server is running before starting the application.
- Check RabbitMQ connection details in the code and update them accordingly.
- Customize the logic in consumers based on your specific requirements.
This project is open source.