We will discuss additional features, APIs and Client libraries available for SQS.
Dead-Letter Queues
SQS supports dead-letter queues. A dead-letter queue is a queue that other (source) queues can target for messages that can't be processed (consumed) successfully. You can set aside and isolate these messages in the dead-letter queue to determine why their processing doesn't succeed.
The redrive policy specifies the source queue, the dead-letter queue, and the conditions under which SQS moves messages to the dead-letter queue. For example, if the source queue has a redrive policy with maxReceiveCount set to 5, SQS will move the message to the dead-letter queue after consumer of the source queue receives a message 5 times without ever processing and deleting it.
To set dead-letter queue for each source queue, can use the RedrivePolicy attribute of the CreateQueue or SetQueueAttributes API action. Can also use management console. Multiple queues can target a single dead-letter queue. Also, dead-letter queue of a FIFO queue must also be a FIFO queue and that of a standard queue must be a standard queue.
Message metadata
You can use message attributes to separate the body of a message from the metadata that describes it. Applications can first inspect only metadata. An SQS message can contain up to 10 metadata attributes.
SQS message attributes take the form of name-type-value triples. The supported types include string, binary, and number (including integer, floating-point, and double).
AmazonSQSBufferedAsyncClient for Java
The AmazonSQSBufferedAsyncClient for Java provides an implementation of the AmazonSQSAsyncClient interface and adds several important features:
-
Automatic batching of multiple SendMessage, DeleteMessage, or ChangeMessageVisibility requests.
-
Prefetching of messages into a local buffer that allows your application to immediately process messages.
Working together, automatic batching and prefetching increase the throughput and reduce the latency of your application while reducing your costs by making fewer Amazon SQS requests.
The AmazonSQSBufferedAsyncClient is part of the AWS SDK for Java and is implemented as a drop-in replacement for the existing AmazonSQSAsyncClient, so no additional changes required, just change client to use the AmazonSQSBufferedAsyncClient for Java instead of the AmazonSQSAsyncClient.
The Amazon SQS Buffered Asynchronous Client does not currently support FIFO queues.
SQS - Other Client Libraries
-
The Amazon SQS Extended Client Library for Java allows applications to send an SQS message that contains a reference to a message payload in Amazon S3.
-
The Amazon SQS Java Messaging Library that implements the JMS 1.1 specification and uses Amazon SQS as the JMS provider.
References (Deprecated):
- heartin's blog
- Log in or register to post comments
Recent comments