STRUCTURED COURSE

Asynchronous Processing with RabbitMQ, Background Jobs and Hangfire

Learn how to manage asynchronous messaging and background processing in ASP.NET Core using RabbitMQ and Hangfire. Build message queues, producers, consumers, background jobs, retries, and scheduled tasks through real-world scenarios.

14 lessons 845 dk C# / .NET 10 / ASP.NET Core Web API / RabbitMQ / Hangfire / Entity Framework Core / SQL Server / Docker / BackgroundService / Dependency Injection
Asynchronous Processing with RabbitMQ, Background Jobs and Hangfire

In this course series, we will learn how to move long-running and non-immediate operations into background processes in ASP.NET Core applications. We will explore RabbitMQ concepts including message queues, producers, consumers, exchanges, queues, routing, acknowledgements, and retry mechanisms. With Hangfire, we will implement fire-and-forget, delayed, recurring, and continuation jobs. Real-world scenarios will include sending emails, generating reports, notifications, data processing, and external integrations. We will also cover error handling, idempotency, dead-letter queues, reliable message processing, and asynchronous communication between services.

What you will learn

Understand RabbitMQ architecture, build producers and consumers, work with queues and exchanges, implement acknowledgements and retries, create background jobs with Hangfire, schedule delayed and recurring jobs, move long-running operations outside API requests, implement error handling and idempotency, use dead-letter queues, and design reliable asynchronous systems.
CURRICULUM

Course lessons

14 lessons
  1. 11. Project Architecture, Development Environment, and RabbitMQ Setup with DockerCreate the .NET 10 ASP.NET Core Web API, Application, Infrastructure, and Worker layers, then run SQL Server and RabbitMQ with Docker Compose and configure connectivity and health checks.75 dk
  2. 22. Separating Long-Running Operations from API Requests and BackgroundService FundamentalsLearn how to move long-running operations out of HTTP requests, build an in-process task queue with BackgroundService and Hosted Service, and handle cancellation and graceful shutdown.75 dk
  3. 33. RabbitMQ Fundamentals and the First Producer-Consumer ImplementationLearn the RabbitMQ broker, queue, producer, and consumer concepts by building a first JSON message publisher and consumer with RabbitMQ.Client.75 dk
  4. 44. Exchanges, Queue Bindings, and Routing StrategiesCompare direct, fanout, and topic exchanges by routing email, notification, and report messages to the correct queues. Learn queue bindings, routing keys, consumer groups, and code-based topology management.45 dk
  5. 55. Reliable Message Consumption: Acknowledgements, Prefetch, and ConcurrencyLearn how to implement manual acknowledgements, BasicAck, BasicNack, BasicReject, prefetch, concurrency, and graceful shutdown in RabbitMQ consumers.75 dk
  6. 66. Message Contracts, Producer Services, and Database IntegrationLearn how to start a domain operation through an API, define shared message contracts, propagate correlation IDs and event metadata, persist an operation with EF Core and SQL Server, and publish a RabbitMQ message.45 dk
  7. 77. Building a BackgroundService-Based RabbitMQ Consumer PipelineMove RabbitMQ consumer logic into ASP.NET Core BackgroundService and build a reliable pipeline for scoped processing, logging, acknowledgements, and cleanup.45 dk
  8. 88. Error Handling, Retry Policies, and Dead-Letter QueuesLearn how to distinguish transient and permanent failures, apply controlled retry policies, and inspect failed messages in a RabbitMQ Dead-Letter Queue.70 dk
  9. 99. Idempotency, Duplicate Messages, and Reliable Processing DesignLearn why duplicate deliveries occur in RabbitMQ and Hangfire, and how message IDs, idempotency keys, database constraints, and transactions make processing safe.75 dk
  10. 1010. Hangfire Setup and Fire-and-Forget JobsIntegrate Hangfire with SQL Server in an ASP.NET Core Web API, secure the Dashboard, and design observable fire-and-forget jobs.50 dk
  11. 1111. Delayed, Recurring, and Continuation Job ScenariosIn this lesson, you will schedule future operations, create recurring Hangfire tasks, and start continuation jobs after successful completion of another job.35 dk
  12. 1212. Combining RabbitMQ and Hangfire in a Unified WorkflowThis lesson builds an end-to-end report-processing workflow in which RabbitMQ handles inter-service events and Hangfire manages application-level jobs. It explains boundaries, reliability, retries, idempotency, and completion notifications.35 dk
  13. 13The Outbox Pattern, Transactional Reliability, and Data ConsistencyLearn how to coordinate database changes and RabbitMQ publication reliably with an Outbox table, EF Core transactions, BackgroundService, and retry handling.35 dk
  14. 1414. Observability, Testing Strategy, and a Production-Ready Asynchronous SystemPrepare RabbitMQ and Hangfire workflows for production with structured logging, correlation IDs, health checks, metrics, testing, Docker, security, and scaling.110 dk
Start the first lesson