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 following list shows the characters (in Unicode) allowed in your message, according to the W3C XML specification. For more information, go to http://www.w3.org/TR/REC-xml/#charsets If you send any characters not included in the list, your request will be rejected.
#x9 | #xA | #xD | [#x20 to #xD7FF] | [#xE000 to #xFFFD] | [#x10000 to #x10FFFF]
Namespace: Amazon.SQS.Model
Assembly: AWSSDK.dll
Version: (assembly version)
public class SendMessageRequest : AmazonSQSRequest IRequestEvents
The SendMessageRequest type exposes the following members
Name | Description | |
---|---|---|
SendMessageRequest() | Empty constructor used to set properties independently even when a simple constructor is available | |
SendMessageRequest(string, string) | Instantiates SendMessageRequest with the parameterized properties |
Name | Type | Description | |
---|---|---|---|
DelaySeconds | System.Int32 |
Gets and sets the property DelaySeconds.
The number of seconds (0 to 900 - 15 minutes) to delay a specific message. Messages
with a positive |
|
MessageAttributes | System.Collections.Generic.Dictionary<System.String, Amazon.SQS.Model.MessageAttributeValue> |
Gets and sets the property MessageAttributes.
Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items. |
|
MessageBody | System.String |
Gets and sets the property MessageBody.
The message to send. String maximum 256 KB in size. For a list of allowed characters, see the preceding important note. |
|
QueueUrl | System.String |
Gets and sets the property QueueUrl.
The URL of the Amazon SQS queue to take action on. |
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