Working with Amazon SQS & SNS in Java

Question:

For the first time I have come across Amazon SQS and Amazon SNS. I will be working with these at my work place in Java.

I have a few questions about these,

  1. I don’t have that much of Java knowledge, I can’t say I have gone that advanced but yes I can say I have an intermediate knowledge. So is it okay for me to touch these areas?
  2. What exactly these services are and how are they useful? A real world example would be useful.

Any suggestions or comments will be useful.

Answer:

I wouldn’t say you need advanced Java knowledge to use them – but why not try and judge for yourself? The AWS SDK for Java is available at http://aws.amazon.com/sdkforjava/

There’s introductory information at http://aws.amazon.com/sns/ and http://aws.amazon.com/sqs/ and links to the detailed documentation.

SQS is useful whenever you need to send reliable, asynchronous messages between parts of a system across the internet. It saves you the effort and expense of setting up your own reliable messaging service, and provides scalability. It is useful when the messages don’t have to arrive instantly, but must not go missing. Billing (records of sale) and other non-time-critical financial transactions would be an example. Note that SQS provides “at least once” behaviour – in rare cases it may deliver a message more than once.

SNS is publish-subscribe, rather than queue-based; it is a more consumer-driven style of messaging using topics and subscriptions rather than plain queues. This style is useful when the producer of information may not know all the potential consumers of the information, and their exact needs. See the example applications in the FAQ at http://aws.amazon.com/sns/faqs/#0

Leave a Reply