activemq.org › Handbook › What is a message broker?
HandbookWhat is a message broker?
A message broker is server software that sits between applications and passes messages from the programs that send them (producers) to the programs that receive them (consumers). The producer hands a message to the broker and carries on; the broker stores it, works out where it should go, and delivers it when a consumer is ready, so the two sides never call each other directly and do not even need to be running at the same time.
ActiveMQ Classic, Apache Artemis and RabbitMQ are message brokers. RabbitMQ's own tutorial sums up the job as software that "accepts and forwards messages". Most brokers also add routing rules, persistence, acknowledgements, transactions and clustering on top of that basic job.
What does a message broker do?
Decouples producers from consumers
Without a broker, a service that needs work done calls the other service directly and waits. With a broker, it sends a message and moves on. Senders and receivers do not know about each other, so you can add, remove, restart or scale either side without touching the other. The Apache Artemis documentation describes messaging systems as a way to loosely couple heterogeneous systems, using an asynchronous message-passing pattern rather than tight request-response calls, although most brokers also support request-response when you need it.
Routes messages to the right place
The two basic delivery styles are point-to-point, where many consumers can read a queue but each message is consumed by at most one of them, and publish-subscribe, where every subscription to a topic gets its own copy. On top of these, each broker has its own routing tools:
- ActiveMQ Classic: JMS queues and topics, virtual and composite destinations, wildcards, and selectors that filter messages with SQL-92 expressions.
- Apache Artemis: addresses with anycast routing (to one queue on the address) or multicast routing (to every queue on the address), plus filter expressions.
- RabbitMQ: exchanges and bindings, where the exchange type (direct, topic, fanout, headers and others) decides which queues or streams get a copy.
Stores messages until they are delivered
Brokers separate durable messages, which are written to permanent storage and survive a broker crash or restart, from non-durable messages, which do not. Each broker has its own store: ActiveMQ Classic uses KahaDB (the default since 5.4) or a JDBC database, Artemis uses an append-only file journal or JDBC, and RabbitMQ's storage depends on the queue type, with quorum queues writing all data to disk before acting on it. When consumers fall behind, the broker holds the backlog; Artemis, for example, pages messages out of memory so a queue can hold millions of messages with limited memory.
Guarantees delivery
A consumer acknowledges each message once it has processed it. If the broker crashes before it receives that acknowledgement, the message is available for delivery again after recovery; in ActiveMQ, a message a consumer received but did not acknowledge before closing is redelivered to another consumer. Brokers let you choose the guarantee you need, and most support sending and acknowledging several messages in one local transaction. JMS brokers such as Classic and Artemis also support XA, so message operations can commit together with a database (see XA transactions).
Messages that keep failing go to a dead letter queue instead of looping forever. In ActiveMQ Classic, a message redelivered more than maximumRedeliveries times (6 by default) is treated as a poison message and can be sent to a dead letter queue; RabbitMQ republishes rejected, expired or over-limit messages to a dead letter exchange. See dead letter queues.
Protects consumers from overload
Brokers control how many messages flow to each client so a fast producer cannot swamp a slow consumer. ActiveMQ Classic pushes messages to consumers up to a prefetch limit, Artemis clients buffer up to a consumer window, and RabbitMQ consumers use a bounded channel prefetch.
Keeps running when a server fails
For high availability, brokers can run as more than one server. ActiveMQ Classic pairs a master with slaves on shared storage and can link brokers into a network; Artemis offers shared-store or replicated backups and clusters that balance messages across nodes; RabbitMQ replicates quorum queues and streams across cluster nodes. Brokers can also be bridged, so a bridge consumes from a queue on one server and forwards to a queue on another, reconnecting automatically over unreliable links such as a wide area network.
Queues and topics
A queue delivers each message to one consumer, which spreads work across a pool of workers. A topic delivers a copy of each message to every subscriber, which suits notifications and events. The differences, including durable subscriptions and when to use each, are covered in message queues, topics and publish/subscribe.
Message broker vs log-based streaming platform
Apache Kafka is often listed next to message brokers, and its servers are even called brokers, but its project describes Kafka as an event streaming platform and its design is different. Kafka's design documentation points out that most messaging systems keep track, on the broker, of which messages have been consumed. Kafka instead appends records to a log, keeps them after they are read, and records a consumer group's progress as a single offset per partition.
| Message broker (ActiveMQ, Artemis, RabbitMQ queues) | Log-based platform (Kafka) | |
|---|---|---|
| After a message is consumed | It is removed from the queue once acknowledged | It stays until the topic's retention period ends |
| Consumption state | Kept by the broker for each message | One offset per partition for each consumer group |
| Delivery | Broker pushes to consumers | Consumers pull from brokers |
| Replay | Limited or none for queues | Rewind the offset and read again |
| Routing | In the broker: destinations, selectors, exchanges | In the producer: choice of topic and partition |
The line is less sharp than it was. RabbitMQ has streams, an append-only log with non-destructive reads, and Kafka 4.2 made share groups, a queue-style way to consume with per-record acknowledgement, production-ready. For the details, see RabbitMQ vs Kafka and ActiveMQ vs Kafka.
Examples of message brokers
| Broker | Current release | Written in | Main API and protocols | License |
|---|---|---|---|---|
| ActiveMQ Classic | 6.4.0 (27 Oct 2026) | Java | JMS; OpenWire, AMQP, STOMP, MQTT | Apache 2.0 |
| Apache Artemis | 2.57.0 (9 Sep 2026) | Java | JMS and Jakarta Messaging; Core, AMQP 1.0, MQTT, STOMP, OpenWire | Apache 2.0 |
| RabbitMQ | 4.4.1 (16 Nov 2026) | Erlang | AMQP 1.0 and 0-9-1, MQTT, STOMP, RabbitMQ Streams | MPL 2.0 |
ActiveMQ Classic is the original Apache ActiveMQ broker, documented at activemq.apache.org; see what is ActiveMQ. Apache Artemis (formerly ActiveMQ Artemis) became its own Apache top-level project on 19 November 2025, with its own site at artemis.apache.org; see ActiveMQ Classic vs Artemis. RabbitMQ is an open-source broker under the Mozilla Public License 2.0, with a commercial edition from Broadcom; see ActiveMQ vs RabbitMQ.
If you would rather not run a broker yourself, managed services exist. Amazon MQ, for example, is a managed message broker service for ActiveMQ Classic and RabbitMQ (see Amazon MQ).
What is a JMS broker?
JMS (Java Message Service) is a Java API for sending and receiving messages. It started as part of Oracle's Java EE; in 2017 it moved to the Eclipse Foundation, and it is now called Jakarta Messaging, part of Jakarta EE. JMS covers both queues and publish-subscribe, and it is implemented by most messaging systems.
A JMS broker is a broker that provides a JMS client library, so Java applications can use the standard API instead of a vendor-specific one. JMS defines only the programming interface, not a wire format, which means a JMS client from one vendor cannot talk directly to another vendor's broker: you use the client library that matches your broker. Support levels differ:
- ActiveMQ Classic has full JMS 1.1 support and partial JMS 2.0 and Jakarta Messaging 3.1 support. The 6.x series uses the Jakarta (
jakarta.jms) API and the 5.19.x series usesjavax.jms; see ActiveMQ versions. - Apache Artemis has full Jakarta Messaging 3.1, JMS 2.0 and JMS 1.1 support.
- RabbitMQ is not built around JMS, but the RabbitMQ JMS client implements the JMS specification on top of RabbitMQ's Java client.
To use a JMS broker from Spring, see ActiveMQ with Spring Boot.
Which protocols do message brokers use?
Because JMS is Java-only, brokers also speak wire protocols that any language can use:
- AMQP 1.0 is an ISO/IEC 19464 and OASIS standard, supported by ActiveMQ Classic, Artemis and RabbitMQ. AMQP 0-9-1 is a different, older protocol that RabbitMQ was originally built on. See AMQP 0-9-1 vs 1.0.
- MQTT is a lightweight publish-subscribe protocol aimed at constrained devices, used for IoT.
- STOMP is a simple text-based protocol that is easy to implement, so clients exist for many languages. See the STOMP protocol.
- OpenWire is ActiveMQ's own cross-language wire protocol, which Artemis also accepts.
When should you use a message broker?
A broker earns its place when work can happen later or somewhere else:
- Handing slow tasks (emails, reports, payments, image processing) to a pool of workers so the user-facing service can answer immediately.
- Absorbing bursts, when producers can briefly send more than consumers can process.
- Notifying several systems of the same event without the sender knowing who they are.
- Connecting systems written in different languages, or Java applications that already use JMS.
- Making sure a message is processed even if the receiving service is down for a while.
If what you need is a long-lived event history that many consumers replay, a log-based platform such as Kafka may fit better. If a caller needs an answer straight away and nothing else cares about the request, a direct call is simpler than a broker.
Frequently asked questions
What is a message broker in simple terms?
A message broker is server software that receives messages from the applications that send them, stores them, and delivers them to the applications that receive them, so sender and receiver never call each other directly and do not need to run at the same time.
What are examples of message brokers?
ActiveMQ Classic, Apache Artemis (formerly ActiveMQ Artemis) and RabbitMQ are open-source message brokers. Managed services also exist, such as Amazon MQ, which runs ActiveMQ Classic and RabbitMQ brokers for you.
What is a JMS broker?
A JMS broker is a message broker that provides a client library for the Java Message Service API, now called Jakarta Messaging. ActiveMQ Classic and Apache Artemis are JMS brokers, and RabbitMQ offers a separate JMS client.
Is Kafka a message broker?
Kafka's servers are called brokers, but the project describes Kafka as an event streaming platform. Unlike a traditional broker, it keeps records after they are consumed and lets consumers re-read them by offset until the topic's retention period ends.
What is the difference between a message broker and a message queue?
A message queue is one of the structures a broker manages: it delivers each message to one consumer. A message broker is the server that hosts queues and topics and handles routing, storage, acknowledgements and failover.
Related guides
- What is a message queue? Queues, topics and publish/subscribe
- What is ActiveMQ?
- ActiveMQ vs RabbitMQ: features, protocols and when to use each
- RabbitMQ vs Kafka: how they differ and which to use
- AMQP: 0-9-1 vs 1.0, and which brokers speak which
- All handbook guides
From the 2006 archive
The original ActiveMQ documentation on these topics, kept as it was published here in 2004–2007. It describes ActiveMQ 4.x and older.
Sources
- Apache Artemis: Messaging Concepts artemis.apache.org
- RabbitMQ tutorial: Hello World (Python) www.rabbitmq.com
- Apache ActiveMQ: home page activemq.apache.org
- Apache Artemis: home page artemis.apache.org
- Apache Kafka 4.4: Design kafka.apache.org
- RabbitMQ: Which protocols does RabbitMQ support? www.rabbitmq.com
- Amazon MQ Developer Guide: What is Amazon MQ? docs.aws.amazon.com