Message Queue Driven Architecture in MuleSoft using Amazon SQS.

Whenever we are building complex systems using microservice architecture, we often encounter need of some asynchronous mechanism for communication between microservices(Mule API’s). In an asynchronous system, events are produced and consumed independently, which means that components do not need to wait for each other to complete their tasks. Message Queue Driven Model In a message-queue… Continue reading Message Queue Driven Architecture in MuleSoft using Amazon SQS.
Whenever we are building complex systems using microservice architecture, we often encounter need of some asynchronous mechanism for communication between microservices(Mule API’s).
In an asynchronous system, events are produced and consumed independently, which means that components do not need to wait for each other to complete their tasks.
Message Queue Driven Model
- In a message-queue model, the publisher pushes messages to a queue where 1 or more subscriber can listen to a particular queue.
- Generally each message is processed by only one consumer which then deletes it from the queue.
- Due to this behavior, it is also sometimes called as Pull Model.
- FIFO queues in Amazon SQS is one of the ways to implement this model.
Event Driven Architecture using Pub/Sub Model
- Event-Driven Architecture (EDA) is a software design pattern or architectural style where the flow of the system’s operation is driven by events or notifications.
- Event-Driven Architecture (EDA) is generally implemented using the Publish-Subscribe (Pub/Sub) messaging pattern as a foundational communication mechanism.
- We generally deal with event emitters (or agents), event consumers (or sinks), and event channels.
- SQS and SNS can work together to form a powerful combination for EDA. We can use SNS to publish events to SNS topics, and use SQS to subscribe to those SNS topics and receive messages in queues which are then published in queues and received asynchronously by consumers using Pub/Sub Model
- A publisher publishes a message to a topic and all the subscribers of that topic receives at least 1 copy of that message.
In the current scope of our blog, we will be dealing with implementing Message Queue Driven Architecture using Amazon SQS in Mulesoft.
I will be assuming that you already have your AWS Account and MuleSoft setup.
Step 1 : Open Amazon SQS page from AWS console and click on Create Queue.
Step 2 : Select FIFO Queue as the type and name your queue as any_name.fifo.
We are using FIFO queue here not only because the order of messages is maintained but because the messages are deleted automatically after successful consumption by a single consumer, ensuring exactly-once processing.
Step 3 : Set the queue configuration as shown in the image.
Step 4 : Amazon SQS provides in-transit encryption by default. To add at-rest encryption to your queue, enable server-side encryption.
Step 5: Open AWS IAM in a new tab and create a user if not exists.
Step 6: Click on the user and copy the ARN to your notepad.
Step 7: Generate Access Key and Secret Access Key for your user and store it securely.
Step 8: Switch back to the create queue tab and select Advanced in Access Policy
Step 9: Embed the following statement in the statement array carefully to prevent connection errors from Mulesoft.
Step 10: Set the queue not to be used as a Dead Letter Queue and click on Create Queue Button.
Dead Letter Queue is a specialized queue used in messaging systems to manage messages that cannot be successfully delivered or processed
Step 11: Open Anypoint Studio and create a demo project.
Step 12: Add Amazon SQS Connector as a dependency from Exchange.
Step 13: Create a global.xml file and create a configuration for SQS.
You need to add your copied ARN to Test Queue ARN to test your connection with AWS SQS.
It is advisable to externalise these credentials in resources folder.
Step 14: Now we are ready to go with SQS and now its time to create a simple POC to demonstrate its usage.
Here we have scheduled a CRON job which will run after every 1 minute to add data into the queue but we need to make sure that the data should be sent in java format only.
We have added a receive message connector which will listen for the messages and log them to the console to validate our POC.
Kudos you have successfully built a POC with Mulesoft and Amazon SQS.
Stay tuned for more such exciting blogs!
Recent Blogs

Connecting MuleSoft and Azure SQL with Entra ID
Introduction Establishing a secure connection between MuleSoft and Azure SQL Database can be challenging, especially if you are using Entra ID (formerly known as Azure Active Directory) for authentication. This blog walks through a fully working configuration for connecting to Azure SQL using ActiveDirectoryServicePrincipal in Mule runtime 4.7.4 with Java 8 — addressing driver setup,… Continue reading Connecting MuleSoft and Azure SQL with Entra ID
Connecting MuleSoft and Azure SQL with Entra ID
Introduction Establishing a secure connection between MuleSoft and Azure SQL Database can be challenging, especially if you are using Entra ID (formerly known as Azure Active Directory) for authentication. This blog walks through a fully working configuration for connecting to Azure SQL using ActiveDirectoryServicePrincipal in Mule runtime 4.7.4 with Java 8 — addressing driver setup,… Continue reading Connecting MuleSoft and Azure SQL with Entra ID

Understanding Salesforce Flow Approval Processes
Introduction: Salesforce introduced Flow Approval Processes in the Spring '25 release. This is an evolved version of the classic approval process model, powered by Flow Orchestrator. The new approach brings unprecedented flexibility, enabling the creation of dynamic, multi-level, and logic-driven approval workflows that are entirely declarative. Continue reading the blog to get a deeper understanding… Continue reading Understanding Salesforce Flow Approval Processes
Understanding Salesforce Flow Approval Processes
Introduction: Salesforce introduced Flow Approval Processes in the Spring '25 release. This is an evolved version of the classic approval process model, powered by Flow Orchestrator. The new approach brings unprecedented flexibility, enabling the creation of dynamic, multi-level, and logic-driven approval workflows that are entirely declarative. Continue reading the blog to get a deeper understanding… Continue reading Understanding Salesforce Flow Approval Processes

Capturing Real-time Record Updation Using LWC
Introduction In modern CRM ecosystems, real-time Salesforce integration and seamless user experiences are no longer optional but fundamental for driving operational efficiency. Imagine your sales reps making important Opportunity changes, but the ERP remains out of sync, leading to confusion and data errors. We understood the necessity to bridge this data gap and implemented a… Continue reading Capturing Real-time Record Updation Using LWC
Capturing Real-time Record Updation Using LWC
Introduction In modern CRM ecosystems, real-time Salesforce integration and seamless user experiences are no longer optional but fundamental for driving operational efficiency. Imagine your sales reps making important Opportunity changes, but the ERP remains out of sync, leading to confusion and data errors. We understood the necessity to bridge this data gap and implemented a… Continue reading Capturing Real-time Record Updation Using LWC

All About Schedulers: Mule 4
In the world of Mule 4, automating repetitive tasks and triggering flows at defined intervals is necessary for building efficient and robust integration solutions. This is where Mule 4 schedulers come into use. This blog post explores the intricacies of scheduling in Mule 4, providing practical examples and best practices to help you get deeper… Continue reading All About Schedulers: Mule 4
All About Schedulers: Mule 4
In the world of Mule 4, automating repetitive tasks and triggering flows at defined intervals is necessary for building efficient and robust integration solutions. This is where Mule 4 schedulers come into use. This blog post explores the intricacies of scheduling in Mule 4, providing practical examples and best practices to help you get deeper… Continue reading All About Schedulers: Mule 4