DEV Community

MOHA PRASATH SA
MOHA PRASATH SA

Posted on

M for Moha, M for Amazon MQ: My First AWS Deep Dive

Cloud computing is not only about storing files or running websites. Modern applications also need different systems and services to communicate with each other reliably.

For my AWS workshop, I explored Amazon MQ, an AWS managed message broker service. Since my name starts with M, I selected an AWS service starting with the same letter.

My blog title is:

M for Moha, M for Amazon MQ: My First AWS Deep Dive

Introduction

In a distributed application, different components often need to exchange information.

For example, imagine a college application where students register for courses. The registration system may need to send information to another system responsible for notifications, while another system may update student records.

If all these systems communicate directly with each other, the architecture can become complicated.

This is where message brokers can help.

Amazon MQ is a managed message broker service provided by AWS. It supports popular messaging technologies such as Apache ActiveMQ Classic and RabbitMQ, allowing applications to communicate using established messaging protocols.

What is Amazon MQ?

Amazon MQ is a managed message broker service from AWS.

A message broker acts as an intermediate system between applications.

Instead of Application A directly communicating with Application B, Application A can send a message to the broker. Application B can then receive the message from the broker.

A simplified example is:

Application A
     |
     | Message
     v
+----------------+
|  Amazon MQ     |
| Message Broker |
+----------------+
     |
     | Message
     v
Application B
Enter fullscreen mode Exit fullscreen mode

Amazon MQ is particularly useful when applications already use messaging technologies such as RabbitMQ or ActiveMQ Classic and organizations want a managed service instead of managing the broker infrastructure themselves.

Why was Amazon MQ created?

Traditional message brokers require organizations to manage servers, software installation, configuration, maintenance, monitoring and availability.

Amazon MQ provides a managed approach.

AWS manages much of the underlying infrastructure, allowing developers to concentrate more on their applications and messaging architecture.

Another important reason is compatibility.

Organizations may already have applications built around established messaging systems. Moving everything to a completely different messaging technology can require significant application changes.

Amazon MQ supports existing messaging technologies and protocols, making migration to AWS easier in suitable scenarios.

How Amazon MQ Works

The basic process can be explained in four steps.

1. Producer creates a message

A producer application generates information.

For example:

"Student registration completed"
Enter fullscreen mode Exit fullscreen mode

2. Message is sent to the broker

The producer sends the message to Amazon MQ.

3. Broker manages the message

The broker receives and manages the message according to the configured messaging system.

4. Consumer receives the message

A consumer application receives and processes the message.

The overall flow is:

+-------------+
|   Producer  |
| Application |
+------+------+
       |
       | Message
       v
+----------------+
|    Amazon MQ   |
| Message Broker |
+-------+--------+
        |
        | Message
        v
+-------------+
|  Consumer   |
| Application |
+-------------+
Enter fullscreen mode Exit fullscreen mode

This approach helps applications communicate without requiring a direct connection between every application component.

Key Features

1. Managed Message Brokers

Amazon MQ provides managed message broker infrastructure.

Instead of manually setting up and maintaining the broker servers, developers can use AWS infrastructure to run their messaging workloads.

2. Support for Popular Messaging Technologies

Amazon MQ supports ActiveMQ Classic and RabbitMQ.

This is useful for organizations that already have applications using these technologies.

3. High Availability Options

Amazon MQ provides deployment options designed for availability and resilience.

For workloads where message delivery is important, organizations can configure appropriate broker deployments and availability options.

4. Security

Amazon MQ integrates with AWS security capabilities.

Applications can use network controls such as VPC security groups, and communication can be protected using encryption and authentication mechanisms supported by the selected broker.

Security configuration should always be designed according to the application's requirements.

College / Student Use Case

A practical college use case would be a Campus Notification System.

Consider a college with multiple applications:

  • Student registration system
  • Attendance system
  • Examination system
  • Notification system
  • Email/SMS service

When a student registers for an event, the registration application could publish a message.


For example:

Student:
Moha

Event:
AWS Cloud Workshop

Status:
Registered
Enter fullscreen mode Exit fullscreen mode

Instead of directly calling the notification system, the registration application can send a message through a message broker.

The notification service can then process the message and send the student a confirmation.

Architecture:

             Student
                |
                v
       +----------------+
       | Registration   |
       | Application    |
       +-------+--------+
               |
               v
        +-------------+
        |  Amazon MQ  |
        +------+------+ 
               |
        +------+------+
        |             |
        v             v
+---------------+ +---------------+
| Email Service | | Notification |
|               | | Service       |
+---------------+ +---------------+
Enter fullscreen mode Exit fullscreen mode

This allows different campus applications to communicate through messaging rather than being tightly connected.

Simple Example

A simplified messaging example can be represented as:

Producer
   |
   | "Assignment submitted"
   v
Amazon MQ
   |
   | Message
   v
Notification Service
   |
   v
Student receives notification
Enter fullscreen mode Exit fullscreen mode

The actual implementation depends on whether RabbitMQ or ActiveMQ Classic is selected and on the application's programming language and messaging protocol.

For a student project, the concept can be demonstrated using a small producer-consumer application.

Advantages

Reduced Infrastructure Management

AWS manages much of the underlying infrastructure, reducing the amount of server administration required.

Compatibility

Applications using supported messaging technologies can potentially move to Amazon MQ without completely redesigning their messaging architecture.

Useful for Distributed Applications

Message brokers can help separate application components and support asynchronous communication.

Integration with AWS

Amazon MQ can operate within AWS networking and security environments, making it useful for applications already running on AWS.

Limitations and Things to Consider

Cost

Amazon MQ is a paid AWS service. Costs depend on factors such as broker instance type, deployment configuration and data transfer.

Students should check current AWS pricing before creating resources.

For a short workshop, resources should be created carefully and deleted after testing to avoid unnecessary charges.

Complexity

Message brokers introduce additional infrastructure and concepts.

Developers need to understand queues, exchanges, topics, consumers, producers, acknowledgements and message delivery behaviour depending on the broker technology.

Scalability

The scalability characteristics depend on the selected broker, configuration and workload.

It is important to design the messaging architecture according to expected traffic rather than assuming unlimited scaling.

Security

Authentication, authorization, encryption, network access and credentials need to be configured properly.

A production messaging system should not expose a broker unnecessarily to the public internet.

What I Learned

Through this AWS workshop task, I understood that cloud computing is not only about hosting applications.

Communication between distributed applications is also an important part of cloud architecture.

Amazon MQ introduced me to the concept of message brokers and showed how producers and consumers can communicate through an intermediate messaging system.

The college notification example also helped me understand how the concept can be applied to a real student or campus application.

Conclusion

Amazon MQ is an AWS managed message broker service that can help applications communicate using established messaging technologies such as RabbitMQ and ActiveMQ Classic.

Its managed infrastructure, compatibility with existing messaging technologies, security capabilities and integration with AWS make it useful for suitable distributed application architectures.

For my AWS workshop, exploring Amazon MQ helped me understand an important cloud concept: applications do not always need to communicate directly with each other. A message broker can act as a reliable communication layer between them.

References

  • AWS Documentation — Amazon MQ
  • AWS Documentation — Amazon MQ for ActiveMQ
  • AWS Documentation — Amazon MQ for RabbitMQ
  • AWS Pricing — Amazon MQ

Always check the latest AWS documentation and pricing before deploying resources.

Top comments (0)