Method: Azure::Queue::QueueService#get_queue_metadata

Defined in:
lib/azure/queue/queue_service.rb

#get_queue_metadata(queue_name, options = {}) ⇒ Object

Public: Returns queue properties, including user-defined metadata.

Attributes

  • queue_name - String. The queue name.

  • options - Hash. Optional parameters.

Options

Accepted key/value pairs in options parameter are:

  • :timeout - Integer. A timeout in seconds.

See msdn.microsoft.com/en-us/library/windowsazure/dd179384

Returns a tuple of (approximate_message_count, metadata)

  • approximate_messages_count - Integer. The approximate number of messages in the queue. This number is not lower than the actual number of messages in the queue, but could be higher.

  • metadata - Hash. The queue metadata (Default: {})



182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/azure/queue/queue_service.rb', line 182

def (queue_name, options={})
  query = { "comp" => "metadata" }
  query["timeout"] = options[:timeout].to_s if options[:timeout]

  uri = queue_uri(queue_name, query)

  response = call(:get, uri)

  approximate_messages_count = response.headers["x-ms-approximate-messages-count"]
   = Serialization.(response.headers)

  return approximate_messages_count.to_i, 
end