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 How It Differs from SQS/SNS
Amazon MQ is a 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. For new applications, SQS/SNS is recommended. 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 designed to migrate these existing applications to AWS with no code changes.
Choosing Between ActiveMQ and RabbitMQ
ActiveMQ has strong affinity with the Java ecosystem, fully supports JMS 2.0, and handles up to 1,000 connections per broker. It is ideal for migrating Java EE and Spring Framework-based applications. 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 and Bindings. 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.
High Availability and Migration Patterns
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. For on-premises migration, you simply create an MQ broker and change the application's connection URL to the MQ endpoint. A common pattern is to connect on-premises to MQ via VPN or Direct Connect and incrementally migrate workloads. For more detailed coverage of Amazon MQ, related books on Amazon are a helpful resource.
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). 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 service for lift-and-shift migration of existing message brokers to AWS. It supports industry-standard protocols for ActiveMQ and RabbitMQ, enabling migration with no code changes. The key decision criterion is to choose SQS/SNS for new development and MQ for migrating existing applications.