Amazon Simple Queue Service Developer Guide
Adding, Updating, and Removing Tags for a Queue ...................................................................... 45
AWS Management Console ................................................................................................ 45
Java ................................................................................................................................ 45
How Queues Work ............................................................................................................................ 47
Basic Prerequisites .................................................................................................................... 47
Standard Queues ...................................................................................................................... 48
Message Ordering ............................................................................................................ 48
At-Least-Once Delivery ..................................................................................................... 48
Consuming Messages Using Short Polling ............................................................................ 48
Working Java Example for Standard Queues ........................................................................ 49
FIFO Queues ............................................................................................................................ 51
Message Ordering ............................................................................................................ 52
FIFO Queue Logic ............................................................................................................. 52
Exactly-Once Processing .................................................................................................... 53
Working Java Example for FIFO Queues .............................................................................. 54
Moving from a Standard Queue to a FIFO Queue ................................................................. 56
Compatibility ................................................................................................................... 56
Queue and Message Identifiers .................................................................................................. 57
General Identifiers ............................................................................................................ 57
Additional Identifiers for FIFO Queues ................................................................................ 58
Resources Required to Process Messages ..................................................................................... 58
Visibility Timeout ..................................................................................................................... 59
...................................................................................................................................... 59
Inflight Messages ............................................................................................................. 60
Setting the Visibility Timeout ............................................................................................ 60
Changing the Visibility Timeout for a Message ..................................................................... 60
Terminating the Visibility Timeout for a Message ................................................................. 61
Visibility Timeout API Actions ............................................................................................ 61
Dead-Letter Queues .................................................................................................................. 61
How Do Dead-Letter Queues Work? .................................................................................... 61
What are the Benefits of Dead-Letter Queues? ..................................................................... 62
How Do Different Queue Types Handle Message Failure? ....................................................... 62
When Should I Use a Dead-Letter Queue? ........................................................................... 63
Getting Started with Dead-Letter Queues ............................................................................ 63
Troubleshooting Dead-Letter Queues .................................................................................. 64
Message Lifecycle ..................................................................................................................... 64
Cost Allocation Tags ................................................................................................................. 65
Overview ......................................................................................................................... 66
Getting Started with Tagging ............................................................................................. 66
Message Attributes ................................................................................................................... 66
Message Attribute Items and Validation .............................................................................. 67
Data Types ...................................................................................................................... 67
Using Message Attributes with the AWS Management Console ............................................... 68
Using Message Attributes with the AWS SDKs ...................................................................... 70
Using Message Attributes with the Amazon SQS Query API ................................................... 71
MD5 Message-Digest Calculation ........................................................................................ 73
Long Polling ............................................................................................................................ 74
The Differences Between Short and Long Polling ................................................................. 74
Enabling Long Polling using the AWS Management Console .................................................. 75
Enabling Long Polling Using the API ................................................................................... 77
Enabling Long Polling Using the Query API ......................................................................... 78
Delay Queues ........................................................................................................................... 78
Creating Delay Queues with the AWS Management Console ................................................... 79
Creating Delay Queues with the Query API .......................................................................... 81
Message Timers ........................................................................................................................ 82
Creating Message Timers Using the Console ........................................................................ 82
Creating Message Timers Using the Query API ..................................................................... 84
iv