AWS SDK Version 2 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

.NET Framework 3.5
 
A list of returned queue attributes.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceResponse
    Amazon.SQS.Model.GetQueueAttributesResult

Namespace: Amazon.SQS.Model
Assembly: AWSSDK.dll
Version: 0.0.3.0

Syntax

C#
public class GetQueueAttributesResult : AmazonWebServiceResponse

The GetQueueAttributesResult type exposes the following members

Constructors

  Name Description
Public Method GetQueueAttributesResult()

Properties

  Name Description
Public Property ApproximateNumberOfMessages Gets the approximate number of messages from the Attributes collection.
Public Property ApproximateNumberOfMessagesDelayed Gets the approximate number of messages delayed from the Attributes collection.
Public Property ApproximateNumberOfMessagesNotVisible Gets the approximate number of messages not visible from the Attributes collection.
Public Property Attributes Gets and sets the property Attributes.

A map of attributes to the respective values.

Public Property ContentLength Returns the content length of the HTTP response.
Public Property CreatedTimestamp Gets the created timestamp from the Attributes collection.
Public Property DelaySeconds Gets the delay in seconds from the Attributes collection.
Public Property HttpStatusCode Returns the status code of the HTTP response.
Public Property LastModifiedTimestamp Gets the last modified timestamp from the Attributes collection.
Public Property MaximumMessageSize Gets the maximum message size from the Attributes collection.
Public Property MessageRetentionPeriod Returns the message retention period from the Attributes collection.
Public Property Policy Gets the queue access policy from the Attributes collection.
Public Property QueueARN Gets the queue arn from the Attributes collection.
Public Property ResponseMetadata Contains additional information about the request, such as the Request Id.
Public Property VisibilityTimeout Gets the visibility timeout from the Attributes collection.

Examples

This example shows how to get queue attributes.

Get queue attributes example

var client = new AmazonSQSClient();

var request = new GetQueueAttributesRequest
{
  QueueUrl = "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyTestQueue",
  AttributeNames = new List<string>() { "All" }
};

var response = client.GetQueueAttributes(request);

Console.WriteLine("Attributes for queue ARN '" + response.QueueARN + "':");
Console.WriteLine("  Approximate number of messages:" +
  response.ApproximateNumberOfMessages);
Console.WriteLine("  Approximate number of messages delayed: " +
  response.ApproximateNumberOfMessagesDelayed);
Console.WriteLine("  Approximate number of messages not visible: " +
  response.ApproximateNumberOfMessagesNotVisible);
Console.WriteLine("  Queue created on: " + response.CreatedTimestamp);
Console.WriteLine("  Delay seconds: " + response.DelaySeconds);
Console.WriteLine("  Queue last modified on: " +
  response.LastModifiedTimestamp);
Console.WriteLine("  Maximum message size: " +
  response.MaximumMessageSize);
Console.WriteLine("  Message retention period: " +
  response.MessageRetentionPeriod);
Console.WriteLine("  Visibility timeout: " + response.VisibilityTimeout);
Console.WriteLine("  Policy: " + response.Policy);
Console.WriteLine("  Attributes:");

foreach (var attr in response.Attributes)
{
  Console.WriteLine("    " + attr.Key + ": " + attr.Value);
}
      

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

.NET for Windows Store apps:
Supported in: Windows 8.1, Windows 8

.NET for Windows Phone:
Supported in: Windows Phone 8.1, Windows Phone 8