Amazon SQS - Popular Features, APIs and Client Libraries

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

  1. 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.

  2. The Amazon SQS Java Messaging Library that implements the JMS 1.1 specification and uses Amazon SQS as the JMS provider.

References (Deprecated): 

Tags: 

Learn Serverless from Serverless Programming Cookbook

Contact

Please first use the contact form or facebook page messaging to connect.

Offline Contact
We currently connect locally for discussions and sessions at Bangalore, India. Please follow us on our facebook page for details.
WhatsApp (Primary): (+91) 7411174113
Phone (Escalations): (+91) 7411174114

Business newsletter

Complete the form below, and we'll send you an e-mail every now and again with all the latest news.

About

CloudMaterials is my blog to share notes and learning materials on Cloud and Data Analytics. My current focus is on Microsoft Azure and Amazon Web Services (AWS).

I like to write and I try to document what I learn to share with others. I believe that knowledge is useless unless you share it; the more you share, the more you learn.

Recent comments

Photo Stream