Running a Message Broker with Amazon MQ - Choosing Between ActiveMQ and RabbitMQ and Migration Patterns
Compare ActiveMQ and RabbitMQ selection criteria, explore migration patterns from on-premises, and learn about high-availability configurations. Also covers when to use SQS/SNS instead.
Amazon MQ's Role and When to Use SQS/SNS Instead
Amazon MQ is a fully managed broker service for ActiveMQ and RabbitMQ. While SQS and SNS are AWS-native messaging services, MQ provides managed operation of industry-standard message brokers. SQS offers unlimited throughput, automatic scaling, and excellent serverless integration, making it the first choice for new cloud-native applications. However, when existing applications depend on the JMS API, AMQP protocol, or complex routing rules (topic selectors, message filters), rewriting for SQS/SNS can be costly. MQ is also appropriate when advanced standard protocol features such as message priority control, transaction management, and complex routing patterns are required. A strategy of gradually refactoring to SQS or SNS after migration is also effective.
- 1. Is this greenfield cloud-native work?If so, SQS and SNS are the first choice: unlimited throughput, automatic scaling and tight integration with serverless architectures.
- 2. Does the existing application depend on standard protocols?When it relies on the JMS API, the AMQP protocol or complex routing rules such as topic selectors and message filters, rewriting for SQS/SNS carries a heavy cost. That is where Amazon MQ fits.
- 3. Do you need the advanced features of a standard protocol?Message priority control, transaction management and complex routing patterns all point to Amazon MQ.
- 4. Decide what the destination looks likeRunning as-is on Amazon MQ first and then refactoring towards SQS and SNS step by step is a valid strategy.
Choosing Between ActiveMQ and RabbitMQ
ActiveMQ has strong affinity with the Java ecosystem, is fully JMS 1.1 compliant, and handles up to 1,000 connections per broker. It supports all ActiveMQ features including queues, topics, virtual topics, and composite destinations. The Network of Brokers configuration connects multiple brokers to build scalable messaging topologies. It simultaneously supports multiple protocols including STOMP, MQTT, and OpenWire, making it useful as a bridge between IoT devices and enterprise applications. RabbitMQ natively supports AMQP 0-9-1 and features flexible routing through Exchanges (Direct, Topic, Fanout, Headers) and Bindings. Cluster deployment configures quorum queues to ensure high availability and data durability. It has rich client libraries for Python, Ruby, Go, .NET, and other languages, making it well suited for polyglot environments. A management UI is provided out of the box for monitoring queue status and message rates from a browser.
| Aspect | ActiveMQ | RabbitMQ |
|---|---|---|
| Standard protocols | Fully compliant with JMS 1.1, and supports STOMP, MQTT and OpenWire at the same time | Native support for AMQP 0-9-1 |
| How messaging is composed | The full feature set is available: queues, topics, virtual topics and composite destinations | Flexible routing through exchanges (direct, topic, fanout, headers) and bindings |
| Availability and topology | A network of brokers links several brokers into a scalable messaging topology | A cluster deployment builds quorum queues for high availability and data durability |
| Connections and clients | Up to 1,000 connections per broker, with a natural fit for the Java ecosystem | A rich set of client libraries for Python, Ruby, Go, .NET and more |
| Best fit | Java-centric enterprises, and bridging IoT devices with enterprise applications | Polyglot environments; the management UI ships as standard, so queue state and message rates are visible from a browser |
High Availability and Security
ActiveMQ's active/standby configuration places two broker instances in different AZs, persisting messages on shared EFS storage. When the primary fails, the standby automatically takes over, with failover completing in tens of seconds. RabbitMQ's cluster deployment configures a 3-node cluster with queue mirroring to ensure message durability. Both engines provide multi-AZ automatic failover, EBS volume message persistence, and KMS encryption at rest as standard. CloudWatch metrics monitor broker health, and CloudTrail provides API operation audit logs. The following is an example of creating a RabbitMQ broker with the AWS CLI:
aws mq create-broker \
--broker-name my-rabbitmq-broker \
--engine-type RABBITMQ \
--engine-version 3.11.20 \
--host-instance-type mq.m5.large \
--deployment-mode CLUSTER_MULTI_AZ \
--users Username=admin,Password=MySecurePass123On-Premises Migration Strategy
Migrating from on-premises ActiveMQ to Amazon MQ involves three steps: broker configuration migration, client connection changes, and network configuration adjustments. Amazon MQ supports the same configuration file format (activemq.xml) as on-premises ActiveMQ, so existing configurations can be applied almost directly. A blue-green migration is recommended, connecting on-premises via VPN or Direct Connect and gradually switching clients to Amazon MQ. For RabbitMQ, the Shovel or Federation plugins enable message forwarding between on-premises and cloud to minimize downtime. For post-migration performance tuning, instance type selection (mq.m5.large for approximately 1,000 msg/sec, mq.m5.4xlarge for approximately 10,000 msg/sec), storage type selection, and prefetch size adjustment are important.
Amazon MQ Pricing
Amazon MQ pricing consists of per-broker-instance hourly charges and storage. An ActiveMQ mq.m5.large costs approximately $0.288 per hour (about $207 per month), while a RabbitMQ mq.m5.large costs approximately $0.302 per hour (about $217 per month) (as of August 2026). Active/standby configurations double the instance cost. Storage costs approximately $0.10 per GB per month. Compared to SQS (approximately $0.40 per million requests), MQ is more expensive, so SQS/SNS should be the first choice for anything other than migrating existing message brokers.
Summary
Amazon MQ is a fully managed service for lift-and-shift migration of existing message brokers to AWS. It supports industry-standard protocols for ActiveMQ and RabbitMQ (JMS, AMQP, STOMP, MQTT), enabling migration with no code changes. With multi-AZ automatic failover, KMS encryption, and CloudWatch monitoring as standard, it minimizes infrastructure operational burden while improving messaging application reliability. The key decision criterion is to choose SQS/SNS for new development and MQ for migrating existing applications.
References (Official AWS Resources)
The primary sources for this page are the official AWS website and documentation. Check the official pages below for the latest specifications and pricing.
If this page and the official documentation disagree, treat the official documentation as authoritative.