Class RightAws::SqsGen2
In: lib/sqs/right_sqs_gen2.rb
Parent: Object

RightAws::SqsGen2 — RightScale‘s Amazon SQS interface, API version 2008-01-01 and later. The RightAws::SqsGen2 class provides a complete interface to the second generation of Amazon‘s Simple Queue Service. For explanations of the semantics of each call, please refer to Amazon‘s documentation at developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=31

RightAws::SqsGen2 is built atop RightAws::SqsGen2Interface, a lower-level procedural API that may be appropriate for certain programs.

Error handling: all operations raise an RightAws::AwsError in case of problems. Note that transient errors are automatically retried.

 sqs    = RightAws::SqsGen2.new(aws_access_key_id, aws_secret_access_key)
 queue1 = sqs.queue('my_awesome_queue')
  ...
 queue2 = RightAws::SqsGen2::Queue.create(sqs, 'my_cool_queue', true)
 puts queue2.size
  ...
 message1 = queue2.receive
 message1.visibility = 0
 puts message1
  ...
 queue2.clear(true)
 queue2.send_message('Ola-la!')
 message2 = queue2.pop
  ...

NB: Second-generation SQS has eliminated the entire access grant mechanism present in Gen 1.

Methods

new   queue   queues  

Classes and Modules

Class RightAws::SqsGen2::Message
Class RightAws::SqsGen2::Queue

Attributes

interface  [R] 

Public Class methods

Public Instance methods

Returns Queue instance by queue name. If the queue does not exist at Amazon SQS and create is true, the method creates it.

 RightAws::SqsGen2.queue('my_awesome_queue') #=> #<RightAws::SqsGen2::Queue:0xb7b626e4 ... >

Retrieves a list of queues. Returns an array of Queue instances.

 RightAws::Sqs.queues #=> array of queues

[Validate]