Other AWS Services

Amazon MQ

5 min read
Updated June 25, 2025
419 characters

Amazon MQ Cheat Sheet

Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that makes it easy to set up and operate message brokers in the cloud.

Features

  • Industry-Standard Protocols: Amazon MQ supports a wide range of industry-standard APIs and protocols, including Java Message Service (JMS), .NET Message Service (NMS), AMQP, STOMP, MQTT, OpenWire, and WebSocket. This allows you to migrate your existing applications with minimal code changes.
  • Managed Service: Amazon MQ handles administrative tasks such as hardware provisioning, broker setup, software upgrades, and failure detection and recovery.
  • High Availability and Durability:
    • Amazon MQ stores your messages redundantly across multiple Availability Zones (AZs).
    • It supports both single-instance brokers for development and testing, and active/standby brokers for high availability in production.
    • In case of a broker failure or an AZ outage, Amazon MQ automatically fails over to the standby broker, ensuring business continuity.

ActiveMQ Features on Amazon MQ

ActiveMQ provides a rich set of messaging features, including:

  • Standard JMS Features:
    • Point-to-point (message queues)
    • Publish-subscribe (topics)
    • Request/reply patterns
    • Persistent and non-persistent messaging modes
    • JMS transactions and distributed (XA) transactions
  • Advanced Messaging Patterns:
    • Composite Destinations: Producers can send a single message to multiple destinations.
    • Virtual Destinations: Publishers can broadcast messages via a topic to a pool of consumers subscribing through queues.
  • Message Ordering: ActiveMQ preserves the order of messages sent by a single producer to all consumers on a topic.
  • Message Groups: This feature enables multiple consumers on a queue to process messages within a specific group in a first-in, first-out (FIFO) order.
  • Redelivery and Dead-Letter Queues (DLQs): ActiveMQ supports message redelivery and the use of DLQs for messages that cannot be delivered to their intended destination.

Amazon MQ Brokers

A message broker is the fundamental building block of Amazon MQ, representing a message broker environment running on the service.

  • Brokers created without public accessibility can only be accessed from within your Virtual Private Cloud (VPC).

Broker Types

  • Single-instance broker: Consists of one broker in a single Availability Zone. It communicates with your application and an AWS storage location. This type is suitable for development and testing.
  • Active/standby broker: Consists of two brokers in two different Availability Zones, configured in a redundant pair for high availability. These brokers communicate synchronously with your application and a shared storage location.

Broker Instance Types

Amazon MQ offers various instance types tailored for different needs:

  • mq.t2.micro / mq.t3.micro: Designed for initial product evaluation and development.
  • mq.m4.large / mq.m5.large: Recommended for default production usage.
  • mq.m5.xlarge, mq.m5.2xlarge, mq.m5.4xlarge: For workloads requiring higher performance.

Network of Brokers

A network of brokers is composed of multiple, simultaneously active single-instance or active/standby brokers. You can configure them in various topologies like concentrator, hub-and-spokes, tree, or mesh to build large-scale, distributed messaging solutions.

Configuration

A configuration in Amazon MQ contains all the settings for your ActiveMQ broker in XML format.

  • Important: Changes made to a configuration are not applied immediately. You must either wait for the next scheduled maintenance window or reboot the broker to apply the changes.

Security and Monitoring

  • Encryption: Amazon MQ provides encryption for your messages both at rest and in transit. Connections to the broker use SSL/TLS.
  • Network Security: Access can be restricted to a private endpoint within your Amazon VPC.
  • Authentication and Authorization:
    • Application-to-broker authentication is handled via username and password.
    • Amazon MQ supports LDAP for authentication and authorization with directory services like Microsoft Active Directory.
  • Compliance: Amazon MQ is HIPAA eligible and meets PCI, SOC, and ISO compliance standards.
  • Monitoring: You can configure Amazon MQ to publish general and audit logs to Amazon CloudWatch Logs for monitoring and analysis.

Amazon MQ Pricing

You are billed for:

  • The time your message broker instance runs (price varies by instance size).
  • The amount of storage you use per month.
  • Standard data transfer fees.

IBM MQ on AWS

While distinct from Amazon MQ, it's worth noting that you can also run IBM MQ on AWS. IBM MQ is messaging middleware that facilitates the integration of diverse applications and business data.

Features of IBM MQ on AWS

  • Provides a single messaging solution for cloud, mobile, IoT, and on-premises environments.
  • Supports client messaging applications from within a VPC, from trusted internet addresses, or via VPN from your on-premises data center.
  • Offers secure message delivery with end-to-end encryption.
  • Achieves dynamic scaling using Auto Scaling Groups, as IBM MQ runs on an EC2 instance based on a pre-built AMI.
  • For high availability, the IBM MQ server is typically placed in a private subnet spanning two AZs. Access is controlled via a public-facing Elastic Load Balancer (ELB) or a bastion host for SSH access.
  • All queue manager data is stored on Amazon EFS for persistence and durability.

Official References: