About this course
About this course
This free course teaches you RabbitMQ from the ground up - no prior experience with message queues needed. You'll start by understanding why applications talk through a message broker at all, run RabbitMQ with Docker, and learn the AMQP model: producers, consumers, queues, exchanges and bindings.
From there you'll write real producers and consumers, route messages with direct, fanout and topic exchanges, and make delivery reliable with acknowledgements, publisher confirms, durability and dead-letter queues. A dedicated chapter wires RabbitMQ into a Laravel app as the queue driver, and the final chapters cover operating RabbitMQ in production and troubleshooting the exact problems you'll hit.
Every lesson builds on the previous one, with small, runnable examples you can try against a local broker. By the end you'll design, run and debug message-driven systems with confidence.
It's written for developers who will actually build on RabbitMQ, not just read about messaging.
Course curriculum
- What is a message queue? What is a message queue and what problem does it solve? Learn how it lets one part of your app hand off work and respond instantly instead of waiting.
- What is RabbitMQ? What is RabbitMQ? A message broker that receives, stores and routes messages between producers and consumers over the AMQP protocol. Explained simply.
- Why use RabbitMQ? Why use RabbitMQ instead of calling a service directly - decoupling, load leveling, reliable retries, and moving slow work into the background.
- RabbitMQ vs other tools RabbitMQ vs Redis, Amazon SQS and Kafka explained simply - how they differ and when RabbitMQ, a smart AMQP broker with routing, is the right fit.
- Run RabbitMQ with Docker Run RabbitMQ locally with one Docker command using the rabbitmq:3-management image, then open the management UI at localhost:15672 and log in.
- The management UI tour A beginner tour of the RabbitMQ management UI - the Overview, Queues, Exchanges, Connections and Channels tabs, and what the message-rate graphs mean.
- Producers, consumers and the broker Learn the three RabbitMQ roles - producer, broker, consumer - and why the producer and consumer never talk directly. The base every other concept builds on.
- Queues A RabbitMQ queue is an ordered FIFO buffer that holds messages until a consumer takes them. See how ordering works and why the queue lives inside the broker.
- Exchanges In RabbitMQ, a producer publishes to an exchange, never straight to a queue. The exchange decides which queues receive the message. Meet the four exchange types.
- Bindings and routing keys A binding links an exchange to a queue; the routing key plus that binding decide delivery. See how RabbitMQ routes a message, with a direct-exchange example.
- Messages and acknowledgements What a RabbitMQ message is - body plus properties - and how an acknowledgement lets a consumer confirm the work so the broker can safely drop the message.
- Connections and channels One TCP connection to RabbitMQ carries many lightweight channels multiplexed over it. Learn channels vs connections and the rule of thumb for using each.
- Installing the PHP client Install the php-amqplib PHP client with Composer and open your first RabbitMQ connection and channel using AMQPStreamConnection, explained step by step.
- Publishing your first message Publish a message with php-amqplib: declare a queue, build an AMQPMessage, and send it to the default exchange with basic_publish, explained line by line.
- Consuming messages Consume RabbitMQ messages in PHP with basic_consume and a callback, then keep the consumer alive with a wait loop so it processes messages as they arrive.
- Work queues Build a RabbitMQ work queue in PHP: run several competing consumers on one queue and watch round-robin distribution spread tasks across two workers in parallel.
- Message acknowledgements Stop losing RabbitMQ messages when a worker crashes. Use manual message acknowledgement: turn off auto-ack, ack after processing, and nack to requeue on failure.
- Durability and persistence Make RabbitMQ survive a broker restart in PHP: declare a durable queue, publish persistent messages with delivery_mode 2, and why you need both together.
- Fair dispatch and prefetch Stop RabbitMQ overloading one busy worker. Set a prefetch count of 1 with basic_qos for fair dispatch, so slow workers aren't handed more messages, in PHP.
- The default exchange The RabbitMQ default exchange explained: why a routing key equal to the queue name works, how the nameless direct exchange routes, and where it stops.
- Direct exchange Declare a RabbitMQ direct exchange, bind a queue with a routing key and publish by exact match in php-amqplib. Route log messages by severity like error.
- Fanout exchange A RabbitMQ fanout exchange ignores the routing key and broadcasts every message to all bound queues. Build pub/sub in php-amqplib with a queue per consumer.
- Topic exchange Route by dotted routing keys with a RabbitMQ topic exchange in php-amqplib. Use the * and # wildcards to subscribe to patterns like order.created.eu.
- Headers exchange Route by message headers instead of a routing key with a RabbitMQ headers exchange in php-amqplib. Understand x-match all vs any and when to use it.
- Dead-letter exchanges Configure a RabbitMQ dead-letter exchange via x-dead-letter-exchange in php-amqplib so rejected, expired or overflowing messages get routed instead of vanishing.
- Acknowledgements deep dive How RabbitMQ manual acknowledgements work: the unacked state, redelivery when a consumer crashes, basic_nack and basic_reject with requeue, and redelivered.
- Publisher confirms RabbitMQ publisher confirms tell a producer the broker stored a message. Learn confirm_select, wait_for_pending_acks, and how they differ from consumer acks.
- Message and queue TTL Set a RabbitMQ message TTL on messages or whole queues: per-message expiration, x-message-ttl, x-expires, and how expired messages can dead-letter.
- Retries and dead-letter queues Build a RabbitMQ retry and dead-letter queue pattern: a wait queue with TTL that dead-letters back to the main queue, plus a DLQ for poison messages.
- Delivery guarantees RabbitMQ at-least-once vs at-most-once delivery, why duplicates happen on redelivery, why exactly-once is a myth, and how idempotent consumers fix it.
- Delayed messages Send a RabbitMQ delayed message: the TTL plus dead-letter trick, and the rabbitmq-delayed-message-exchange plugin with x-delay, plus when to use each.
- How Laravel queues work See how Laravel queues work - Jobs, connections, drivers - and why you point them at RabbitMQ instead of the database or Redis, with the AMQP hidden.
- Installing the Laravel RabbitMQ driver Install the Laravel RabbitMQ queue driver with composer require vyuldashev/laravel-queue-rabbitmq. It registers a rabbitmq connection driver you point config at.
- Configuring the connection Add a rabbitmq connection to config/queue.php, set RABBITMQ_HOST, RABBITMQ_PORT, user, password and vhost in .env, then set QUEUE_CONNECTION=rabbitmq.
- Dispatching jobs Create a Job with make:job, then dispatch Laravel jobs to RabbitMQ with SendWelcomeEmail::dispatch(user). Route work to named queues with onQueue().
- Running workers Run php artisan queue:work rabbitmq to consume jobs from RabbitMQ. Learn how the worker acks messages, the --queue flag, and keeping it alive with Supervisor.
- Failed jobs and retries Use --tries and --backoff, store dead jobs in the failed_jobs table, and re-run them with queue:retry. See how Laravel retries map to RabbitMQ redelivery.
- Priorities and multiple queues Route jobs to named queues with onQueue, then run queue:work --queue=high,low so a worker drains high-priority queues before lower ones in RabbitMQ.
- Monitoring with the management UI Monitor RabbitMQ queues in the management UI: Ready vs Unacked, publish and deliver rates, consumer count and memory, and what a rising backlog means.
- rabbitmqctl basics Common rabbitmqctl commands run inside Docker: list_queues, list_exchanges, list_connections and status, plus when the CLI beats the management UI.
- Users, vhosts and permissions Set up RabbitMQ users and permissions for production: create users with add_user and set_user_tags, isolate apps with vhosts, and grant least-privilege access.
- Quorum queues RabbitMQ quorum queues are the modern replicated, durable queue type. Declare one with x-queue-type, see why they replaced mirrored queues, and weigh the trade-offs.
- Clustering and high availability How RabbitMQ clustering delivers high availability: node availability, quorum queues for replication, and why a cluster alone is not a throughput button.
- Memory and disk alarms How the RabbitMQ memory alarm and free-disk alarm work: the high-watermark thresholds, why the broker blocks publishers with flow control, and how to clear it.
- Securing RabbitMQ Secure RabbitMQ in production: enable TLS on 5671, use strong credentials, delete the guest user, firewall ports 5672 and 15672, and grant least-privilege users.
- A Laravel + RabbitMQ Docker stack A full annotated docker-compose.yml running a Laravel app, RabbitMQ and a queue worker, with the .env wiring, a data volume and service-name networking.
- Messaging patterns A map of the core RabbitMQ messaging patterns - work queue, pub/sub, routing, RPC and delayed messages - and which course chapter taught each one.
- RabbitMQ connection refused Fix RabbitMQ 'Connection refused' / ECONNREFUSED on port 5672: broker not running, wrong host, wrong port or bad credentials. Diagnose it step by step.
- RabbitMQ unacked messages piling up Fix RabbitMQ unacked messages piling up: a consumer took messages but never acknowledged them. Spot the cause in the UI and fix forgotten acks or a bad prefetch.
- RabbitMQ consumer not receiving messages Fix a RabbitMQ consumer that connects but receives no messages: wrong queue name, missing binding, wrong routing key, unbound exchange or wrong vhost.
- RabbitMQ memory alarm and blocked publishers Fix RabbitMQ publishers hanging with connection.blocked: a memory or disk alarm triggered flow control. Free resources or raise the watermark to unblock.