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.
Namespace: Amazon.SQS.Model
Assembly: AWSSDK.dll
Version: 0.0.3.0
public class GetQueueAttributesResult : AmazonWebServiceResponse
The GetQueueAttributesResult type exposes the following members
| Name | Description | |
|---|---|---|
|
GetQueueAttributesResult() |
| Name | Description | |
|---|---|---|
|
ApproximateNumberOfMessages | Gets the approximate number of messages from the Attributes collection. |
|
ApproximateNumberOfMessagesDelayed | Gets the approximate number of messages delayed from the Attributes collection. |
|
ApproximateNumberOfMessagesNotVisible | Gets the approximate number of messages not visible from the Attributes collection. |
|
Attributes |
Gets and sets the property Attributes.
A map of attributes to the respective values. |
|
ContentLength | Returns the content length of the HTTP response. |
|
CreatedTimestamp | Gets the created timestamp from the Attributes collection. |
|
DelaySeconds | Gets the delay in seconds from the Attributes collection. |
|
HttpStatusCode | Returns the status code of the HTTP response. |
|
LastModifiedTimestamp | Gets the last modified timestamp from the Attributes collection. |
|
MaximumMessageSize | Gets the maximum message size from the Attributes collection. |
|
MessageRetentionPeriod | Returns the message retention period from the Attributes collection. |
|
Policy | Gets the queue access policy from the Attributes collection. |
|
QueueARN | Gets the queue arn from the Attributes collection. |
|
ResponseMetadata | Contains additional information about the request, such as the Request Id. |
|
VisibilityTimeout | Gets the visibility timeout from the Attributes collection. |
This example shows how to get queue attributes.
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);
}
.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