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 4.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: (assembly version)

Syntax

C#
public class GetQueueAttributesResult : AmazonWebServiceResponse

The GetQueueAttributesResult type exposes the following members

Constructors

NameDescription
Public Method GetQueueAttributesResult()

Properties

NameTypeDescription
Public Property ApproximateNumberOfMessages System.Int32 Gets the approximate number of messages from the Attributes collection.
Public Property ApproximateNumberOfMessagesDelayed System.Int32 Gets the approximate number of messages delayed from the Attributes collection.
Public Property ApproximateNumberOfMessagesNotVisible System.Int32 Gets the approximate number of messages not visible from the Attributes collection.
Public Property Attributes System.Collections.Generic.Dictionary<System.String, System.String> Gets and sets the property Attributes.

A map of attributes to the respective values.

Public Property ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property CreatedTimestamp System.DateTime Gets the created timestamp from the Attributes collection.
Public Property DelaySeconds System.Int32 Gets the delay in seconds from the Attributes collection.
Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property LastModifiedTimestamp System.DateTime Gets the last modified timestamp from the Attributes collection.
Public Property MaximumMessageSize System.Int32 Gets the maximum message size from the Attributes collection.
Public Property MessageRetentionPeriod System.Int32 Returns the message retention period from the Attributes collection.
Public Property Policy System.String Gets the queue access policy from the Attributes collection.
Public Property QueueARN System.String Gets the queue arn from the Attributes collection.
Public Property ResponseMetadata Amazon.Runtime.ResponseMetadata Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property VisibilityTimeout System.Int32 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