Amazon.SQS.AmazonSQSClient.SendMessage C# (CSharp) Method

SendMessage() public method

Delivers a message to the specified queue.

The following list shows the characters (in Unicode) that are allowed in your message, according to the W3C XML specification:

  • #x9

  • #xA

  • #xD

  • #x20 to #xD7FF

  • #xE000 to #xFFFD

  • #x10000 to #x10FFFF

For more information, see RFC1321. If you send any characters that aren't included in this list, your request is rejected.

/// The message contains characters outside the allowed set. /// /// Error code 400. Unsupported operation. ///
public SendMessage ( string queueUrl, string messageBody ) : SendMessageResponse
queueUrl string The URL of the Amazon SQS queue to which a message is sent. Queue URLs are case-sensitive.
messageBody string The message to send. The maximum string size is 256 KB. The following list shows the characters (in Unicode) that are allowed in your message, according to the W3C XML specification:
  • #x9
  • #xA
  • #xD
  • #x20 to #xD7FF
  • #xE000 to #xFFFD
  • #x10000 to #x10FFFF
For more information, see RFC1321. If you send any characters that aren't included in this list, your request is rejected.
return Amazon.SQS.Model.SendMessageResponse
        public SendMessageResponse SendMessage(string queueUrl, string messageBody)
        {
            var request = new SendMessageRequest();
            request.QueueUrl = queueUrl;
            request.MessageBody = messageBody;
            return SendMessage(request);
        }

Same methods

AmazonSQSClient::SendMessage ( SendMessageRequest request ) : SendMessageResponse

Usage Example

        static void WriteToQueue(AWSCredentials credentials)
        {
            AmazonSQSClient client = new AmazonSQSClient(credentials, RegionEndpoint.USEast1);

            string message = "my message";
            string queueUrl = "https://sqs.us-east-1.amazonaws.com/025631894481/aws-talk";

            SendMessageResponse sendMessageResponse = client.SendMessage(queueUrl, message);
        }
All Usage Examples Of Amazon.SQS.AmazonSQSClient::SendMessage
AmazonSQSClient