4
votes

I am new to RabbitMQ and trying to figure out the difference between a broker and an exchange.

From what I've read, the terms seem to almost be used interchangeably and in the diagrams, a broker seems to encompass both the exchange and the queues.

From "RabbitMQ Succinctly" book:

Exchanges are AMQP entities where messages are sent to the message broker. Exchanges take a message and then route it to one or more queues

So what is a broker? In the RabbitMQ management there is a tab for "Exchanges", but not for brokers. Can I interact with a broker directly or is this only done by the exchange?

1

1 Answers

9
votes

"Broker" is a generic term for the type of messaging system that RabbitMQ is. It's a centralized messaging system, with a server that handles the routing and delivery of messages, etc.

This paper from ZeroMQ is good to understand the differences between brokered and brokerless: http://zeromq.org/whitepapers:brokerless (although this paper is fairly biased toward brokerless model, both are good and both have uses. i tend to prefer rabbitmq / brokered system, but not always)

From the other perspective, here is RabbitMQ's broker vs brokerless post: https://www.rabbitmq.com/blog/2010/09/22/broker-vs-brokerless/

For the most part, just substitute "rabbitmq server" in your mind, when you see the work "broker" and you'll be good to go.

The exchange, as you've noted, the thing through which you publish a message, in RabbitMQ. It handles the bindings and routing of the messages, depending on the exchange type.