Amazon SQS Resources
I’ve got some new resources to help you make better use of the Amazon Simple Queue Service, or SQS.
First, our new Stock Quote Example shows how SQS can be used to build a scalable and reliable stock quote system. The user specifies a list of stock symbols, and the application retrieves quotes for these symbols from a financial web service. The sample illustrates how SQS adds reliability and scalability with minimum effort. It also shows how SQS can be incorporated into a Visual Studio component for easy development and reuse. The component fires a ResponseEvent when a new quote is available, enabling the creation of a clean, event-driven user interface. The code includes an adaptive polling mechanism which minimises SQS calls (and costs) when there’s no work to do, while maximizing throughput when there is work to be done. The application includes a benchmarking feature to illustrate the efficiency improvements made possible by adaptive polling. Finally, the article shows how the sample can be run on Amazon EC2 and shows that network latency is greately reduced because EC2 and SQS are both running inside of the Amazon network. You can get the code here.
Second, Prabhakar Chaganti of Ylastic added another article to his AWS series. In part 4 he talks about Reliable Messaging with SQS. In the article he covers the basic attributes of SQS (reliability, simplicity, security, scalability, and low cost). He discusses SQS messages, and the all-important visibility timeout. From there he proceeds to talk about SQS design considerations, pricing, and how to get started. He then shows how to install and configure the Boto library for Python, and to exercise the various features of SQS: creating queues, listing queues, deleting them, and sending and retrieving messages.
I hope that you enjoy these articles on SQS. If you build something interesting as a result of having read them, leave a note in the comments so that we know.