Today's Deep-Dive: RabbitMQ
Ep. 273

Today's Deep-Dive: RabbitMQ

Episode description

RabbitMQ is a versatile, open-source messaging broker designed to ensure reliable communication between different software applications. It acts as an intermediary, managing queues and guaranteeing message delivery even under challenging conditions, such as network outages or traffic spikes. RabbitMQ supports multiple protocols, including AMQP, MQTT, and STOMP, allowing it to connect a wide range of services written in various programming languages. This flexibility makes it ideal for complex microservices, real-time data streams, and IoT device management. The technology ensures reliability through acknowledgements and replication, with features like quorum queues providing high data consistency. RabbitMQ is widely adopted by major tech companies and is maintained by a combination of community efforts and VMware Tanzu, now under Broadcom. It offers both community support and enterprise-grade options for mission-critical applications, making it a robust choice for modern, distributed systems.

Gain digital sovereignty now and save costs

Let’s have a look at your digital challenges together. What tools are you currently using? Are your processes optimal? How is the state of backups and security updates?

Digital Souvereignty is easily achived with Open Source software (which usually cost way less, too). Our division Safeserver offers hosting, operation and maintenance for countless Free and Open Source tools.

Try it now for 1 Euro - 30 days free!

Download transcript (.srt)
0:00

Welcome to the deep dive! You know, modern applications, whether they're these tiny

0:04

little

0:04

microservices or huge sprawling IoT networks, they all seem to face this one

0:09

constant headache.

0:10

It's, uh, how do all these different parts actually talk to each other reliably?

0:15

Especially when, say, one part gets totally swamped with traffic, or maybe it just

0:19

goes

0:19

offline for a bit, because if that connection breaks, well, your whole system can

0:23

just grind

0:23

to a halt. So today, we're doing a deep dive into a technology built specifically

0:28

to solve

0:29

that exact problem. Rabbit MQ. People sometimes call it One Broker to queue them

0:35

all.

0:35

Yeah, our mission today is really to unpack this, uh, this seemingly complex bit of

0:40

infrastructure,

0:41

the messaging and streaming broker. We want to demystify it completely so that you,

0:45

the curious learner, can get a real handle on what it actually does, how it works

0:49

under the hood,

0:49

and maybe more importantly, why pretty much every big tech company is using it,

0:53

even if you're totally new to this stuff, starting from scratch.

0:56

But before we jump right in, we really want to thank the supporter of the show,

0:58

Safe Server.

0:59

Safe Server manages the hosting for complex software, just like RabbitMQ,

1:03

and they're great at supporting your digital transformation journey.

1:06

You can check out more about what they offer at www.safe-server.de.

1:11

Yeah, and that mission is spot on, because RabbitMQ, despite the maybe slightly

1:15

technical name,

1:16

is actually a pretty elegant concept when you break it down. Essentially, think of

1:20

it as a

1:20

really powerful enterprise-ready, open-source intermediary, like the ultimate

1:26

communication hub,

1:28

you know. It sits right in the middle between different software applications,

1:31

and its whole job is making sure their conversations are, well, efficient,

1:35

definitely reliable, and pretty versatile, too. Just a perfect fit for anything

1:39

involving

1:39

distributed systems. So that could be complex microservices, or maybe applications

1:44

handling

1:44

streams of real-time data, or even managing these massive fleets of IoT devices.

1:50

And critically,

1:50

it's open-source, it's licensed under the Mozilla Public License 2.0, which is

1:55

great for adoption.

1:56

Okay, let's unpack that a bit. If it's a broker, like you said, that sounds like it's

2:00

doing more

2:01

than just passing notes, right? What's the actual heavy lifting involved in brokering

2:05

a message?

2:06

Right. The heavy lifting is all about reliability and decoupling. So you have one

2:11

application,

2:12

a publisher sending a message, and another application, a consumer, that needs to

2:16

receive

2:16

it. The broker, RabbitMQ, sits right there in the middle managing the queue, like a

2:21

post office

2:22

sorting mail. Its main job really is guaranteeing that message is safe and sound

2:27

and will eventually

2:28

get delivered. Even if that consumer application is down for maintenance, or maybe

2:32

it's just totally

2:33

overwhelmed by a sudden traffic spike, or maybe it just hasn't gotten around to

2:36

checking its mailbox

2:37

yet. Okay, that makes sense. What I find fascinating looking at the Sork material

2:42

is the flexibility it

2:43

offers. It seems like RabbitMQ doesn't lock you into just one way of doing things.

2:48

How does it

2:48

manage to talk to everything from like a huge enterprise server down to some tiny

2:53

sensor on a

2:54

drone? That is definitely one of its core strengths. It's fundamentally a multi-protocol

2:59

broker,

2:59

which basically means it speaks lots of different standardized languages, and that's

3:04

what lets you

3:04

connect almost any service written in pretty much any programming language you can

3:08

think of

3:09

without getting stuck with one vendor. No lock-in. Gotcha. For someone just

3:13

starting out, you probably

3:14

don't need to memorize all the version numbers, but knowing the main protocols

3:17

helps. You've got

3:19

MQP that's the advanced message queuing protocol. Think of that as the kind of

3:22

heavyweight enterprise

3:24

backbone. It's excellent for really complex, reliable messaging, especially when

3:29

you need

3:29

transactions. Then there's MQTT. Now MQTT is super lightweight. It was specifically

3:35

designed for

3:35

devices that are, let's say, constrained. You know, tiny sensors, maybe smart home

3:40

gadgets,

3:40

where bandwidth and battery power are really limited. Ah, okay. So that's the

3:44

difference

3:45

between, like, a massive bank server talking to another bank server versus, I don't

3:50

know,

3:50

a thousand smart thermostats trying to update their temperature every minute.

3:54

Exactly that

3:54

kind of difference, yeah. And then finally, it also supports stomp. Stomp is often

3:58

used for,

3:59

let's say, simpler messaging tasks. It integrates really easily into web browsers,

4:03

for instance.

4:04

And yeah, RabbitMQ is clever enough to even let you communicate using these

4:08

protocols,

4:08

like MQTT and stomp, directly over WebSockets. So your web app running right in the

4:14

browser

4:14

can talk natively to the messaging system. This is pretty neat. Okay, this is where

4:19

it starts

4:20

getting really interesting for me. We know it can talk to almost anything now, but

4:24

how does it handle

4:25

the sheer complexity? You know, different messages, different needs. How does it

4:29

decide if a message

4:30

should go to just one place or maybe 10 different places or, I don't know, maybe

4:34

hold on to it until

4:35

next Tuesday? Right, that decision making comes down to its flexibility in defining

4:39

the message

4:40

route. You get really granular control over how messages flow through the system.

4:44

This includes

4:45

things like setting up complex routing and filtering rules, so you can publish just

4:50

one

4:50

single event, but only specific consumers that match certain criteria will actually

4:55

receive it.

4:55

It also has features like federation. Now, federation is basically connecting

5:00

multiple

5:01

RabbitMQ brokers together, maybe across different data vendors or even different

5:05

continents.

5:06

Okay. And of course, it supports streaming capabilities too, which address a

5:10

slightly

5:10

different need than traditional queues, more about that persistent flow of events.

5:14

But all that flexibility doesn't mean much if it's not safe, right? If a service is

5:19

handling

5:19

something critical, say processing that concert ticket purchase you mentioned,

5:24

losing that message

5:24

would be, well, catastrophic. How does RabbitMQ go beyond just best effort delivery

5:30

and actually

5:30

guarantee reliability? Good question. Reliability really stands on two main pillars.

5:36

The first one

5:36

is acknowledgement. So the broker holds onto that message securely until the

5:41

receiving consumer

5:43

explicitly sends back a confirmation, basically saying, yep, got it, processed it

5:48

successfully.

5:49

Okay. If that consumer crashes or fails before it sends that acknowledgement,

5:54

the message just stays safe and sound back in the queue, ready to be delivered

5:58

again,

5:58

maybe to another instance of that consumer. Okay. That's one pillar. What's the

6:02

second?

6:02

The second pillar is replication, especially when you're running RabbitMQ as a

6:06

cluster of

6:06

multiple servers, which is common for high availability. RabbitMQ makes sure

6:11

messages

6:11

aren't just sitting on one single machine. It offers specific queue types designed

6:15

for high safety,

6:16

like quorum queues. Think of quorum queues like a kind of digital safety deposit

6:20

box.

6:20

It requires a majority of quorum of the nodes in the cluster to agree and confirm,

6:24

yes, we have

6:25

safely stored this message before it's considered truly durable. This gives you

6:29

really strong

6:30

guarantees about data consistency and safety, even if one of your servers suddenly

6:34

fails.

6:35

And you mentioned streams earlier. Is that just a fancy name for a queue that runs

6:39

really fast,

6:40

or is it something different? It's fundamentally different,

6:42

actually. Streams are designed for persistence and keeping history. A standard

6:47

queue is usually

6:48

destructive. Once a consumer successfully processes a message, it's gone from the

6:52

queue.

6:53

A stream, on the other hand, works like a persistent append-only log. Imagine a

6:58

news ticker

6:59

that just keeps running and never forgets what it showed. Consumers read events

7:03

from the stream

7:04

without deleting them. And importantly, they can even rewind and reread older

7:08

events whenever they

7:09

need to. This is super powerful for modern event-driven architectures where

7:14

different

7:15

systems might need to process the same event history at different times or speeds.

7:19

That distinction makes a lot more sense now. Okay, let's try and ground this in the

7:23

real world. For

7:23

someone listening, maybe building an application right now, can we look at those

7:27

four specific

7:28

examples from the source material where RabbitMQ really shines? Absolutely. Let's

7:32

start with maybe

7:33

the most common use case, decoupling services. We can call this the load absorber

7:37

pattern.

7:38

Right, okay. So, say my main backend service generates some kind of notification

7:44

event.

7:45

Maybe it needs to trigger both an email and a push notification. How does RabbitMQ

7:50

act as that load

7:51

absorber here? Well, instead of your main service having to directly call the email

7:55

system, wait for

7:56

it, then call the push notification system, wait for that, which can be slow and

8:00

brittle. It just

8:02

publishes one simple message to RabbitMQ, something like notification needed for

8:06

user x, and that's

8:08

it. Its job is done instantly. RabbitMQ then takes over. You'd have two completely

8:12

separate independent

8:13

microservices, maybe an email manager and a push manager, each subscribe to receive

8:17

those notification

8:18

messages from the queue. So the main service avoids the load, it finishes its tasks

8:22

super quickly,

8:23

and the best part, you can take the entire email manager offline for maintenance,

8:27

and the push

8:27

notifications would still go out without interruption. The core application isn't

8:31

blocked. That's

8:32

powerful decoupling. Okay, next up, remote procedure call, RPC. You called this the

8:39

organized waiter.

8:40

How does this simplify something complex, like that example of selling concert

8:44

tickets across

8:45

lots of different websites or kiosks where you need really careful validation?

8:49

Right, RPC using

8:50

a message queue is about getting a synchronized response back, but doing it with

8:54

the safety and

8:55

orderliness of the queue. So the kiosk wanting to sell a ticket publishes an order

9:00

message,

9:00

but critically, it includes a unique tag, like a tracking number. This is called a

9:05

correlation ID.

9:06

It's like the waiter writing down your specific table number on the order slip.

9:10

Got it. The back-end service that validates ticket availability processes these

9:14

orders

9:14

sequentially from the queue first served. This avoids complex database locking or

9:19

race conditions.

9:21

Now crucially, the kiosk doesn't just sit there hammering the server asking, is it

9:24

done yet?

9:24

Instead, it subscribes to a specific reply queue listening only for a response

9:29

message

9:29

that contains its original correlation ID. Ah, so it waits patiently for its

9:33

specific order.

9:35

Exactly. It's an organized wait. This lets the system safely handle potentially

9:39

heavy complex

9:40

requests, ensuring that even if there's a sudden flood of ticket orders, they're

9:44

processed reliably

9:45

in order and each response gets back to the right requester. Using acknowledgments

9:50

and maybe those

9:51

quorum queues we mentioned adds even more safety here. Makes sense. Okay, third use

9:55

case. Streaming,

9:56

the multitasker. The example was a video platform where uploading one video

10:01

triggers maybe half a

10:02

dozen different background tasks, transcoding, analysis, notifying followers. How

10:07

does a Rabbit

10:07

MQ stream handle that efficiently? This is where streams really shine. The initial

10:12

upload service

10:13

simply appends a single event, like new video uploaded ID123, to a dedicated Rabbit

10:19

MQ stream.

10:19

Because the stream is non-destructive, like we discussed, multiple different

10:23

backend applications

10:24

can all subscribe to the same stream and read that same new video event. Simultaneously.

10:29

Simultaneously, yes, but independently. So the notify followers service might read

10:33

the event

10:34

and act on it immediately. But maybe the really heavy video analysis service reads

10:38

the event,

10:39

notes its position in the stream, but decides to only actually process it later,

10:43

perhaps during

10:44

off-peak hours to save resources. It doesn't block anyone else, and it doesn't

10:48

require the

10:48

message to be published multiple times. Everyone reads the same event log at their

10:52

own pace.

10:53

That allows for huge scale and really varied workflows without duplicating messages.

10:58

Okay, finally, that really cool, slightly self-like example. IoT and the patient

11:03

buffering system,

11:04

referencing those package delivery space drones orbiting Kepler-438b dealing with

11:10

terrible network

11:10

connections. Yeah, it's a great illustration of chaining RabbitMQ deployments. The

11:15

idea is that

11:15

each drone runs its own local, miniature standalone RabbitMQ node. While it's out

11:20

there, potentially

11:21

disconnected for long periods, it collects all its status reports, position,

11:25

battery, package status,

11:27

and buffers them securely in its local RabbitMQ. So it holds onto them? It holds

11:31

onto them safely.

11:32

Then, when the planets align, metaphorically speaking, and a network connection

11:36

back to the

11:37

main server becomes available, the drone's local RabbitMQ uses a built-in feature,

11:42

often called

11:43

shovels or similar federation plugins, to automatically and reliably transfer all

11:48

those

11:48

cache reports upstream to the central RabbitMQ server on the home planet or the

11:53

main data center.

11:54

Wow. This ability to chain brokers lets you build incredibly resilient systems that

11:59

can handle being

12:00

offline. And because you'd likely use MQTT for the drone to broker communication

12:04

due to its lightweight

12:05

nature, RabbitMQ is also exceptionally good at handling potentially millions of

12:10

concurrent

12:11

connections from huge swarms of these devices. It's clearly incredibly robust

12:15

technology,

12:16

but who's actually building and maintaining this? Is it purely a community effort

12:20

or is there a big

12:21

company behind the scenes? It's actually a really successful mix of both, which is

12:24

often a good sign.

12:25

RabbitMQ itself is free and fully open source. It has a massive, really active

12:29

global community.

12:30

You can see that on GitHub last I checked something like 13,200 stars and 4,000 forks,

12:35

which is significant engagement. Yeah. The core server development, though,

12:39

is primarily done by engineers at VMware Tanzu. And VMware Tanzu is now owned by

12:45

Broadcom,

12:46

who holds the toppy right, dating way back to its origins around 2007.

12:51

And the feedback from people actually using it seems overwhelmingly positive. We

12:56

saw that quote

12:56

from one user who basically said RabbitMQ is the one message broker that hasn't

13:00

given me grief in

13:02

my career. That's quite an endorsement. It really is. That kind of real-world

13:06

battle-tested feedback speaks volumes, doesn't it? There was another great one

13:10

someone

13:11

mentioned running RabbitMQ for over eight years in some really demanding

13:14

distributed setups,

13:16

including, get this, a fleet of 180 buses where every single bus ran its own local

13:21

RabbitMQ

13:22

instance. And they said they never had a single issue in all those years. That

13:26

level of reliability

13:27

in such a challenging environment is precisely why so many companies trust it.

13:31

Absolutely. So

13:32

if an organization decides, okay, this is critical for us, we need this kind of

13:36

reliability,

13:36

but maybe they need more formal support than community forums can offer, what are

13:40

their

13:40

options? They have a pretty clear choice, really. The community support is

13:44

excellent. You've got

13:45

GitHub discussions, a very active community discord server, even IRC channels like

13:50

hashtag

13:50

rabidmq on LibreChat for real-time help from other users and sometimes developers.

13:56

But for

13:56

businesses running truly mission-critical applications, where you need things like

14:00

guaranteed response times, help with disaster recovery planning, compliance

14:03

requirements,

14:04

and maybe 247 availability. Well, that's where the commercial offering comes in.

14:08

Broadcom,

14:09

through Tanzu, offers an enterprise-grade version of rabidmq. And the key benefit

14:14

there is you get

14:14

247 expert support, often directly from the core engineers who actually build and

14:19

maintain the

14:20

product. So you have immediate access to deep specialized knowledge when you're

14:23

dealing with

14:24

high stakes production issues. Right, that makes sense. So to kind of wrap this up

14:28

for you, the

14:29

learner listening in, think of rabidmq as this indispensable, highly flexible, and

14:35

really incredibly

14:36

reliable air traffic controller for all the messages flying around inside your

14:40

software systems. It's

14:41

the thing that makes sure every message, whether it's just a simple little

14:44

notification or super

14:45

critical financial transaction, gets exactly where it needs to go safely and

14:49

efficiently.

14:50

And it does this regardless of crazy network conditions or sudden server overloads.

14:54

Absolutely.

14:55

And maybe here's a final thought to leave you with, something to mull over based on

14:58

what we've

14:59

discussed. Given rabidmq's incredible interoperability, how it supports everything

15:04

from heavyweight enterprise protocols like AMQP to lightweight IoT ones like MQTT,

15:10

and even browser friendly stuff like stomp, and the fact that you can find client

15:14

libraries to

15:15

talk to it in virtually any programming language out there. How might that sheer

15:19

flexibility,

15:20

that ability to mix and match languages and protocols so easily, fundamentally

15:25

change how

15:25

modern development teams think about technology choices? Could it essentially

15:29

eliminate the fear

15:30

of vendor lock-in when they need to pivot or adopt new tools? That really drives

15:33

home the power of

15:34

having that open source multi-protocol foundation, doesn't it? Well, thank you for

15:38

joining us for

15:39

this deep dive into the world of RabbitMQ, and we want to give one more shout out

15:43

to our sponsor,

15:44

SafeServer. Remember, they handle hosting for complex software like RabbitMQ and

15:48

can really

15:48

support your digital transformation efforts. Find out more at www.SafeServer.de.

15:56

keep exploring.

15:56

keep exploring.