What is AmazonMQ, How you can Setup and Connect to a RabbitMQ Instance via the Browser.
Tags: aws, amazonmq, rabbitmq, messaging
Published: 2023-07-16 14:58:05

## What is Amazon MQ Service?
AmazonMQ is a fully managed open source messaging service for Apache ActiveMQ and RabbitMQ that makes it easy to setup, operate messaging in the cloud. With AmazonMQ you can migrate your on-prem workloads created in ApacheMQ and ActiveMQ as is, without any code rewrites.

Amazon MQ uses industry-standard APIs and protocols such as JMS, NMS, AMQP, MQTT, STOMP, OpenWire, and WebSocket for messaging. It handles administrative activities such as broker configuration, software updates, and failure detection and recovery.

#### A Few Use Cases for AmazonMQ
* **Low-latency event messaging**: Ensure low latency for thousands of events, so that applications have the most recent information possible.


* **Migrate with flexible configurations**: Migrate from on premises to Amazon MQ with active/standby, a network of brokers, or cluster configurations.


* **Invoke AWS Lambda functions**: Integrate applications and use Lambda functions to poll the Amazon MQ message broker.


#### Amazon MQ Features

* **Managed Service**: With Amazon MQ you can use the AWS Management Console, AWS CloudFormation, the Command Line Interface (CLI), or simple API calls to launch a production-ready message broker in minutes. Amazon MQ manages administrative tasks such as hardware provisioning, broker setup, software upgrades, and failure detection and recovery.


* **Security**: Amazon MQ provides encryption of your messages at rest and in transit. It’s easy to ensure that your messages are securely stored in an encrypted format. Connections to the broker use SSL, and access can be restricted to a private endpoint within your Amazon VPC, which allows you to isolate your broker in your own virtual network.


* **Monitoring**: Amazon MQ is integrated with Amazon CloudWatch and AWS CloudTrail. With CloudWatch you can monitor metrics on your brokers, queues, and topics. For example, you can monitor the depth of your queues and generate alarms if messages aren’t getting through. Using CloudTrail, you can log, continuously monitor, and retain Amazon MQ API calls.


* **Broker Instance Types**: Amazon MQ currently supports seven broker instance types: mq.t2.micro, mq.t3.micro, mq.m4.large, mq.m5.large, mq.m5.xlarge, mq.m5.2xlarge, and mq.m5.4xlarge, which provide various combinations of CPU, memory, and network performance.

* **Amazon MQ is integrated with AWS IAM**: Identity and Access Management or IAM provides you the ability to control the actions that your IAM users and groups can take on specific Amazon MQ brokers. Authentication from applications to the broker itself is provided using username and password-based authentication, and optionally using LDAP for ActiveMQ brokers.


**Amazon MQ also supports both single instance brokers, suitable for evaluation and testing, and replicated highly available cluster deployment modes for production workloads.**



#### How to Setup a Amazon MQ Instance

- 
 **Log into the AWS Console** and **Search for Amazon MQ**.

- 
 **From the Amazon MQ page**, Click on **Get Started** button.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/go3lrt7ymorx6bzypp3d.PNG)

- 
 Next you need to select the **Broker Engine Type**. In there **select RabbitMQ** as we are going to create a RabbitMQ broker as part of the exercise.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pd1awp4x0uz4xcbdlmti.PNG)

- 
 Next, **specify a user name and a password** which you will need to login to the RabbitMQ instance once it is been setup in the AWS Cloud.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zbqcc9pnk2320hjf5b2k.PNG)

- 
Then, **specify a name for the Broker** and **select the Broker instance size** from the drop down menu.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8jmf23ux5kjdf55q9aq6.PNG)

- 
**Set the Broker Engine version** and **Leave the other settings as is** as shown below. If you want to be able to connect to the broker from a specific VPC. Then that option is also available.

**Since this is a demo, we will allow public access option.**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7fovolzvt03eawel2720.PNG)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f8qjanljst6oestinpj6.PNG)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbe9rylyfijqisj27pah.PNG)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tkri3knk021v3k0kl8ik.PNG)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0pdtw9bpa125nritzlm.PNG)

- 
Then **review the configurations** and **click create** to create the broker. Typically, **Broker creation would take around 15 - 20 minutes.**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3iqfhfy7uq13zzks8wn.PNG)

- 
**Now, your broker has been created successfully** as reflected in the status.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/exmoi1e8zn4x94e50z7q.PNG)

- 
**Click the Broker entry from the table and scroll down** to view the settings (ARN and other details).


- 
**Click on the RabbitMQ Web Console URL** and click to open the **RabbitMQ Management Dashboard**.
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bn946rwnobhvwppx4rkp.PNG)

- 
**Use the credential specified in step #4 above to login to the RabbitMQ dashboard**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w927vj5kcgxe9qab9nl6.PNG)

- 
**Awesome!** 🙌 **You are logged into the RabbitMQ Management Console**. **Now you can now setup channels, exchanges, queues, topics and start send/receive messages via the broker.**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eamc8b9gmmpok7o08bno.PNG)


**Thank you for stopping for a moment to read the article!** 😊