This is a C# application that utilizes RabbitMQ messaging system to handle bookings for a service.
Sends booking requests to a RabbitMQ exchange Listens for booking confirmation messages from RabbitMQ queue Handles booking failures and retries Provides an easy-to-use API for integrating booking functionality into other applications Supports concurrent bookings for improved performance Prerequisites .NET Core SDK (version X.X or higher) RabbitMQ server installed and running
Clone the repository:
bash Copy code git clone https://github.com/your-username/csharp-rabbitmq-booking-app.git Navigate to the project directory:
bash Copy code cd csharp-rabbitmq-booking-app Build the solution:
Copy code dotnet build Configuration Open the appsettings.json file and update the following settings with your RabbitMQ configuration:
json Copy code { "RabbitMQ": { "Host": "localhost", "Port": 5672, "Username": "guest", "Password": "guest", "ExchangeName": "booking-exchange", "QueueName": "booking-queue", "RoutingKey": "booking" } }
Start the RabbitMQ server if it's not running.
arduino Copy code dotnet run This will start the booking application and it will begin listening for booking requests.
Integrate the booking functionality into your own application by sending a POST request to http://localhost:5000/api/booking with a JSON payload containing the booking details.
Example Request:
bash Copy code curl -X POST -H "Content-Type: application/json" -d '{ "name": "John Doe", "date": "2023-05-17", "time": "15:00", "service": "Massage" }' http://localhost:5000/api/booking The booking application will process the request and send a booking confirmation message to the RabbitMQ queue. You can implement a listener in your own application to receive and handle the confirmation message.
Contributions are welcome! If you have any improvements or bug fixes, feel free to submit a pull request. Please make sure to follow the code style and write appropriate tests for new features.
This project is licensed under the MIT License.
Thanks to the creators of RabbitMQ for providing a reliable messaging system. Special thanks to the contributors of the libraries used in this application. Contact If you have any questions, you can reach me at [email protected].
Happy booking!