- 5 minutes to read

Amazon SQS Queues

A queue that fills up means orders, invoices, or shipments waiting for something that has stopped. A dead-letter queue with one message means one transaction failed for good. The Nodinite AWS Monitoring Agent watches both, and lets your support team look at the messages, send one, empty a queue, or send failed messages back for another try, all from a Monitor View.

  • ✅ Warning and Error on the message count and on the age of the oldest message
  • ✅ One message on a dead-letter queue is an Error by default
  • ✅ View, delete, post, purge, and redrive with Remote Actions, each confirmed first

Understanding Queues and Dead-Letter Queues

graph LR Producer["fa:fa-paper-plane Producer"] --> Queue["fa:fa-list SQS Queue
OK, Warning, Error"] Queue --> Consumer["fa:fa-gears Consumer"] Queue -->|"failed too often"| Dlq["fa:fa-skull-crossbones Dead-Letter Queue
Error at 1 message"] Dlq -->|"Start redrive"| Queue style Producer fill:#2678BD style Queue fill:#93d16d style Consumer fill:#2678BD style Dlq fill:#c33d34

A queue (green when OK) carries messages from a producer to a consumer. A message that fails too often moves to its dead-letter queue (red: Error from the first message, by default). Start redrive sends the messages back to their source queues, so the consumers process them again.

Category Which queues Evaluated
SQS Queue Every queue that isn't a dead-letter queue Message count (Warning 100, Error 1000) and age of the oldest message in seconds (Warning 300, Error 900)
SQS Dead-Letter Queue Every queue that another queue points at with a redrive policy, and every queue whose name matches the Dead-letter queue name pattern (by default, names ending in dlq, deadletter, dead-letter, or dead-letter-queue, also with .fifo) Message count (Warning 1, Error 1)

The oldest-message age comes from CloudWatch and is the highest value of the past minutes, so it can stay high right after a purge. The agent therefore only checks the age while there are messages on the queue (visible, in flight, or delayed); an empty queue is back to OK on the next cycle. AWS can take up to a minute to report the new count after a purge. More rules: Monitoring AWS.

Remote Actions on a Queue

Open the Action menu of the queue in a Monitor View. Every view has a Refresh button, and the queue's name links to it in the AWS console (View in the AWS Console).

Action What it does Needs
Details The queue's attributes, its Current values (such as Messages available, Messages in flight, and Messages delayed), and its Evaluation thresholds with where each comes from Read-only policy
Edit The thresholds of this queue Read-only policy
Messages Opens View Messages: lists, shows, and deletes messages sqs:ReceiveMessage; deleting also sqs:DeleteMessage
Post Sends one message sqs:SendMessage
Purge Deletes every message on the queue sqs:PurgeQueue

Edit

Each threshold shows its Account default. Enter whole numbers: 0 switches a check off, and an empty field uses the account default. Add a Description if you like, and click Save. The thresholds apply to this queue only: they are stored in the Specific list of the account Configuration and take effect on the next monitoring cycle. Use account defaults removes them again.

View Messages

View Messages lists the messages that were sent in a date range, From (UTC) and To (UTC). It opens on the last 24 hours, and the date fields always show the range the list was made with. Each row shows the Message id, Sent (UTC), Size (bytes), and Receives.

  • The eye button shows the message body under the row, and hides it again.
  • The bin button deletes that message: This operation cannot be undone. Are you sure you want to delete this message from the queue?
  • Tick messages, or the box in the header to select all, and click Delete selected. It asks the same before it deletes.

SQS can't be browsed or searched by date, so the agent receives up to 100 messages without deleting them and filters those: on a busy queue the list is a sample. A message you looked at returns to the queue a few seconds later, but its receive count goes up by one.

Post

Post sends one message to the queue:

Field What to enter
Message body Required. The message, for example a JSON document, sent exactly as entered
Message group id FIFO queue only, required
Message deduplication id FIFO queue only, required unless content-based deduplication is on for the queue
Delay (seconds) Standard queue only, optional, at most 900
Message attributes Optional, one name=value per line, at most 10

Click Send message and confirm: Are you sure you want to send this message to the queue? The consumers of the queue will process it.

Purge

Purge runs from the Action menu itself. Nodinite asks Are you sure that you want to execute action Purge on resource …: Yes deletes every message on the queue, and nothing happens on No. A purge can't be undone, and AWS can take up to 60 seconds to finish it.

Remote Actions on a Dead-Letter Queue

Action What it does Needs
Details Attributes, current values, and thresholds, plus its Source queues and its Redrive tasks Read-only policy
Edit The thresholds of this dead-letter queue, as for a queue Read-only policy
Messages Peek at the messages on the dead-letter queue, with their body sqs:ReceiveMessage
Start redrive Opens Details, where Start redrive moves the messages back to their source queues sqs:StartMessageMoveTask, plus sqs:ReceiveMessage and sqs:DeleteMessage on the dead-letter queue and sqs:SendMessage on the source queues, because AWS moves them with the caller's rights
Purge Deletes every message on the dead-letter queue, as for a queue sqs:PurgeQueue

Source queues lists the queues that send their failed messages here. When the list is empty, the queue is monitored as a dead-letter queue only because its name matches the Dead-letter queue name pattern. Redrive tasks shows the recent redrives with their Status, Started (UTC), Destination, Moved, To move, and Failure reason.

Start redrive asks Are you sure you want to move all messages on this dead-letter queue back to their source queues? The messages are processed again by the consumers of those queues. So fix the cause first. Every action is recorded in Log Audits. The ready-made IAM policies are on Prerequisites.

Next Steps