A message broker is a program that lets apps, systems and services communicate and exchange information. It acts as a middleman: it receives a message, validates it, stores it, decides where it goes and delivers it. It's like the post office: you drop off the letter and they carry it, without you knowing which mail carrier delivers it. With 10 services talking to each other, instead of 45 direct connections, each connects only to the broker.
A broker translates messages between messaging protocols, which are the rules for how a message is built and sent. That way, services written in different languages or running on different platforms can talk to each other. It's like an interpreter at a meeting: one speaks Japanese, the other Spanish, and they still understand each other. A Python service and a Java one exchange thousands of messages per second without knowing each other.
Some widely used message brokers are NATS, Apache Kafka, RabbitMQ and ActiveMQ. RabbitMQ is the classic for task queues; Kafka is used for huge volumes of events; NATS is very lightweight and fast. Choosing one is like choosing transport: for 1 small package, a motorbike; for 1,000 boxes, a truck. They all send messages, but each shines in one case.
The broker decouples services: the sender doesn't need to know where the receiver is, whether it's on or how many there are. Decoupling means 2 parts can change or go down without breaking the other. It's like leaving a voicemail: it doesn't matter if the other person is there, they listen when they can. If the email service goes down for 10 minutes, orders keep coming in and the emails go out later.
Event streaming platforms, like Apache Kafka, only distribute pub/sub style, but they're built for huge volumes and scale easily. They order messages into topics and keep them for a fixed time, for example 7 days. Unlike a broker, they don't guarantee delivery or know which consumer received what. It's like a radio: it broadcasts to millions but doesn't know who listened; a broker is like a courier who asks for a signature on delivery.
An ESB (enterprise service bus) is a big infrastructure that connects all of a company's systems. It's complex, expensive to maintain, hard to scale and hard to fix when it fails. Message brokers are a lightweight alternative: they give the key part, letting services communicate, at a lower cost. That's why they fit microservices. It's like replacing a whole building's phone switchboard with cell phones: they do the essentials, cheaper.