Building applications from individual components that each perform a discrete function is a best practice that improves scalability and reliability. Using message queues, you can send, store, and receive messages between application components at any volume, without losing messages or requiring other services to be always available.
Most message queues provide both push and pull options for retrieving messages. Pull means continuously querying the queue for new messages. Push means that a consumer is notified when a message is available (this is also called Pub/Sub messaging). You can also use long-polling to allow pulls to wait a specified amount of time for new messages to arrive before completing.
Message queues may store multiple copies of messages for redundancy and high availability, and resend messages in the event of communication failures or errors to ensure they are delivered at least once.
A dead-letter queue is a queue to which other queues can send messages that can't be processed successfully. This makes it easy to set them aside for further inspection without blocking the queue processing or spending CPU cycles on a message that might never be consumed successfully.
To learn more about dead-letter queues, read our blog, Using Amazon SQS Dead-Letter Queues to Control Message Failure. To learn how to use dead-letter queues in Amazon SQS, see our Developer Guide.
Poison pills are special messages that can be received, but not processed. They are a mechanism used in order to signal a consumer to end its work so it is no longer waiting for new inputs, and is similar to closing a socket in a client/server model.
Message queues will authenticate applications that try to access the queue, and allow you to use encryption to encrypt messages over the network as well as in the queue itself. To learn more about queue security on AWS, read our blog, Server-Side Encryption for Amazon Simple Queue Service (SQS). You can also learn more about the security features of Amazon SQS in our Developer Guide.
Get started for free with just three simple commands.