MuleSoft Integration with Amazon SQS PART-2

Prathmesh Durge
3 min readMay 28, 2024

--

Welcome to Part 2 of our series on Amazon Simple Queue Service (SQS). In this installment, we’ll explore various SQS connector functionalities in MuleSoft. If you haven’t already read Part 1, you can catch up by following the link below.

MuleSoft Integration with Amazon SQS PART-1

Send Message Operation

The Amazon SQS Send Message connector is for sending messages to an Amazon SQS queue.

· Start by dragging an HTTP Listener onto the canvas to initiate the flow.

· Next, drag an SQS Send Message connector onto the canvas.

· Double-click on the SQS Send Message connector to configure it. Remember to input the Queue URL.

Once the flow is set up, you can trigger it by sending an HTTP request to the endpoint defined in the HTTP Listener using Postman. In the request body, provide the message that you want to publish to the queue. This will publish the message to the SQS queue you specified in the SQS Send Message connector.

Having kicked off our workflow, we’re all set to dispatch a message to the designated SQS queue.

Publishing message to queue

If the output appears as shown below, then we have successfully accomplished message publication to the queue.

After publishing the message to the queue, you can verify it by accessing the AWS console. Simply search for SQS in the search bar, click on ‘Simple Queue Service’ and navigate to the specific queue where you published the message. Look into the ‘Messages Available’ section. (below, you’ll see that we have one message in the queue).

Receive messages Operation

The Amazon SQS Receive Messages connector is designed to subscribe to messages from an Amazon SQS queue.

· Begin by dragging a Receive Messages component onto the canvas to kickstart the flow.

· Double-click on the SQS Receive Messages connector to configure it. Remember to input the Queue URL.

· Configure the flow as depicted below.

Below, you’ll notice that we’ve successfully established the ability to subscribe to messages from the SQS queue. These messages mirror those which we published to the exchange in the previous step.

After subscribing to a message from the queue, you can confirm it by accessing the AWS Console. Simply search for SQS in the search bar, click on ‘Simple Queue Service’ and navigate to the specific queue from which you subscribed to the message. Look into the ‘Messages Available’ section. (Below, you’ll see that we had one message in the queue earlier, and now we have subscribed to that same message).

Conclusion:

This blog covers the Send Message and Receive Messages operations using the Amazon SQS Connector in Mule 4. We’ve demonstrated how to send and receive messages effectively.

--

--

Prathmesh Durge

Technical Consultant at Perficient|MuleSoft Mentor|Mulesoft Certified Architect & Developer (MCPA & MCD)|Workato|Azure Logic App|Boomi|Celigo|Informatica|Solace