Amazon Simple Queue Service: Batch Operations, Delay Queue, and Message Timers
We have added some nice new features to the Simple Queue Service. You can now use batch operations to send and delete messages with greater efficiency and at a lower cost. You can make any of your queues into a delay queue, and you can also use message timers to set an initial visibility delay on individual messages.
The new SendMessageBatch and DeleteMessageBatch functions give you the ability to operate on up to ten messages at a time. You can send individual messages of up to 64 KB (65,536 bytes); however, the sum of the lengths of the messages in a single batch cannot exceed 64 KB. The batch operations are more efficient for you (less network round trips between your application and AWS) and are also more economical since you can now send or delete up to ten messages while paying for just one request.
You can now set up any of your queues to be a delay queue. Setting a non-zero value for the queue’s DelaySeconds attribute delays each new message’s availability within the queue accordingly. For example, if you set the attribute to 120 for one of your queues, messages subsequently posted to it will become visible two minutes (120 seconds) after posting.
You can now set the DelaySeconds attribute on individual messages (using SendMessage) or on batches of messages (using SendMessageBatch). Messsages that have a non-zero delay will not become available until after the delay has elapsed. You could use this new feature to deliver certain messages at predictable intervals. For example, you could send a series of messages with delays of 0, 60, 120, and 180 seconds for receipt at one minute intervals.
The AWS Management Console includes support for Delay Queues and Message Timers. You can create new delay queues by specifying a non-zero Delivery Delay:
You can also set or modify the Delivery Delay for an existing queue:
You can also set a delay on a message at posting time: