Reading Time: 3 minutes

I’m probably preaching to the choir here, but application messaging is extremely important for a wide variety of applications. It allows you to:

  • Decouple application message processing from receiving
  • Orchestrate data between two applications
  • Handle the loss of a server without losing data
  • Process data at a later date when you have more capacity

Yet, creating a reliable, highly scalable messaging infrastructure is extremely difficult – and sometimes not even an option. Amazon SQS takes that problem off your hands – it’s a hosted, highly scalable, reliable queueing service for applications. And now you can use it easily in your Mule applications with our new SQS support.

How to use it

It’s quite simple to connect Mule to SQS. There are two primary things you need to know how to do – send and receive. Use the <send-message> processor to send the payload as a String to Amazon. For example, this snippet will take an HTTP POST message and put it on SQS.

Could not embed GitHub Gist 1474545: API rate limit exceeded for 34.66.93.163. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

(You can optionally specify the payload attribute to use an expression to send something other than the message payload to SQS).

Receiving is just as easy; simply use the <receive-messages> processor. Here’s an example which receives messages from a queue and puts them in Mongo DB:

Could not embed GitHub Gist 1474551: API rate limit exceeded for 34.66.93.163. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

When a message is received, your flow will process it. If the flow executes without an exception, the connector will automatically delete it from the queue. You can also optionally delete it yourself by setting the “preserveMessages” attribute to true and using the <delete-message> processor. In addition to sending and receiving, you can do all the other SQS operations including modifying queue attributes, permissions or get message counts.

You can learn more information and get started with the SQS connector on MuleForge.

latest report
Learn why we are the Leaders in API management and iPaaS