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.
The number of seconds (0 to 900 - 15 minutes) to delay a specific message. Messages with a positive
DelaySecondsvalue become available for processing after the delay time is finished. If you don't specify a value, the default value for the queue applies.
Namespace: Amazon.SQS.Model
Assembly: AWSSDK.dll
Version: 0.0.3.0
public Int32 DelaySeconds { get; set; }
This example shows how to send a message.
var client = new AmazonSQSClient();
var request = new SendMessageRequest
{
DelaySeconds = (int)TimeSpan.FromSeconds(5).TotalSeconds,
MessageAttributes = new Dictionary<string, MessageAttributeValue>
{
{
"MyNameAttribute", new MessageAttributeValue
{ DataType = "String", StringValue = "John Doe" }
},
{
"MyAddressAttribute", new MessageAttributeValue
{ DataType = "String", StringValue = "123 Main St." }
},
{
"MyRegionAttribute", new MessageAttributeValue
{ DataType = "String", StringValue = "Any Town, United States" }
}
},
MessageBody = "John Doe customer information.",
QueueUrl = "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyTestQueue"
};
var response = client.SendMessage(request);
Console.WriteLine("For message ID '" + response.MessageId + "':");
Console.WriteLine(" MD5 of message attributes: " +
response.MD5OfMessageAttributes);
Console.WriteLine(" MD5 of message body: " + response.MD5OfMessageBody);
.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