Class | AWS::SQS::QueueCollection |
In: |
lib/aws/sqs/queue_collection.rb
|
Parent: | Object |
Represents all the {Queue} objects in your account.
If you have permission to access a queue created by another account, you can also use this collection to access that queue by URL.
@example Printing the URLs of all queues
pp sqs.queues.map(&:url)
@example Filtering queues by queue name prefix
pp sqs.queues.with_prefix("production_").map(&:url)
@example Accessing a queue by URL
url = "http://sqs.us-east-1.amazonaws.com/123456789012/myqueue" sqs.queues[url].send_message("HELLO")
prefix | [R] |
@return [String] The queue name prefix by which this
collection is filtered. |
Creates a new queue.
@note If you delete a queue, you must wait at least 60
seconds before creating a queue with the same name.
@param [String] name The name to use for the queue created.
Constraints: Maximum 80 characters; alphanumeric characters, hyphens (-), and underscores (_) are allowed. To successfully create a new queue, you must provide a name that is unique within the scope of your own queues. If you provide the name of an existing queue, a new queue isn't created and an error isn't returned. Instead, the request succeeds and the queue URL for the existing queue is returned. Exception: if you provide a value for +:default_visibility_timeout+ that is different from the value for the existing queue, you receive an error.
@param [Hash] opts Additional options for creating the
queue.
@option opts [Integer] :default_visibility_timeout The
visibility timeout (in seconds) to use for this queue.
@return [Queue] The newly created queue.
@param [String] prefix The queue name prefix. @return [QueueCollection] A new collection representing only
the queues whose names start with the given prefix.