Skip to Content

Amazon MQ

Amazon MQ as managed ActiveMQ and RabbitMQ for applications that use open messaging protocols, its limits, and its high availability setup.

What it is

SQS and SNS are cloud-native services that use AWS's own APIs. Traditional applications running on premises often use open messaging protocols instead: MQTT, AMQP, STOMP, OpenWire, WSS (WebSocket), through message brokers such as Apache ActiveMQ or RabbitMQ.

When migrating such an application to the cloud, rewriting it to use SQS and SNS takes time. Instead, the application can move to Amazon MQ: a managed message broker service for RabbitMQ and Apache ActiveMQ. The applications keep their existing protocols and code; AWS runs the brokers.

  • Amazon MQ has both queue features (like SQS) and topic features (like SNS).
  • It doesn't scale as much as SQS and SNS.
  • It runs on servers (brokers the customer sizes), and can run Multi-AZ with failover.

High availability

Amazon MQ high availability for ActiveMQ: a client connects to the active broker in one Availability Zone, with a standby broker in another; both use shared Amazon EFS storage, and on failure the client fails over to the standby Amazon MQ high availability for ActiveMQ: a client connects to the active broker in one Availability Zone, with a standby broker in another; both use shared Amazon EFS storage, and on failure the client fails over to the standby

An active and a standby broker sharing storage.
  • ActiveMQ: an active/standby deployment runs one broker in each of two AZs, sharing Amazon EFS storage. Clients connect to the active broker; if it fails, the standby takes over with the same data, and clients fail over to it.
  • RabbitMQ: a cluster deployment runs three broker nodes in three AZs behind a Network Load Balancer, with queues replicated across them.

Real-world examples

  • A bank moves a Java app that uses JMS over ActiveMQ to AWS. With Amazon MQ, the code doesn't change; only the broker URL does.
  • A logistics company keeps using RabbitMQ and AMQP for its warehouse systems, but stops patching broker servers itself.

Exam tips

  • "Migrate an on-premises app using MQTT, AMQP, STOMP, OpenWire or JMS without changing code" → Amazon MQ.
  • "ActiveMQ or RabbitMQ in the cloud, managed" → Amazon MQ.
  • "New cloud-native application, massive scale" → SQS / SNS rather than Amazon MQ.
  • "High availability for Amazon MQ" → active/standby across two AZs (ActiveMQ) or a three-node cluster (RabbitMQ).

Common traps

  • "Amazon MQ scales like SQS." It runs on brokers the customer sizes; SQS scales without limit.
  • "Rewrite the legacy app to use SQS to move to AWS." Possible, but Amazon MQ avoids the rewrite.

Check yourself

A broker runs by the hour (about $0.03 an hour for the smallest single-instance ActiveMQ broker, double for active/standby), so instead of a lab:

AWS documentation

On this page

Open notes

Spotted a mistake?

These notes are open source. Suggest a fix, or star the repo if they helped you.

Suggest an edit

For AI agents: llms.txt · llms-full.txt