This project demonstrates the usage of RabbitMQ to process jobs using debouncing. When multiple messages with the same payload are invoked within a specified delay period, only the last message is processed.
- Queue Jobs: Queue jobs by sending a POST request to the API's endpoint
/queue-job
with the message payload and a delay in milliseconds. - Debouncing: Ensures that only the last message with the same payload is processed within the delay period.
- RabbitMQ Plugins: Utilizes the
rabbitmq_delayed_message_exchange
,rabbitmq_message_deduplication
, andrabbitmq_shovel
plugins.
curl --request POST \
--url 'http://localhost:5000/queue-job?message=HelloWorld\&delay=3000'
-
Start RabbitMQ:
docker-compose up
-
Run the Project:
dotnet run --project src/Debounce.Api/Debounce.Api.csproj
-
Invoke a Message: Use the curl command provided above to test the API.
This project uses the following RabbitMQ plugins to achieve the desired functionality:
These plugins are automatically installed and configured by the Docker setup provided in this project.
Build the project using Cake.
-
Restore Local Tools:
dotnet tool restore
-
Run Cake:
dotnet cake
Contributions are welcome! Please open an issue or submit a pull request for any changes or improvements.
This project is licensed under the MIT License. See the LICENSE file for details.