User guide

Table Of Contents
To create an Amazon SQS queue
1. Create and initialize a CreateQueueRequest instance. Provide the name of your queue and specify
a visibility timeout for your queue messages, as follows:
CreateQueueRequest createQueueRequest =
new CreateQueueRequest();
createQueueRequest.QueueName = "MySQSQueue";
createQueueRequest.DefaultVisibilityTimeout = 10;
Your queue name must only be composed of alphanumeric characters, hyphens, and underscores.
Any message in the queue remains in the queue unless the specified visibility timeout is exceeded.
The default visibility timeout for a queue is 30 seconds. For more information about visibility timeouts,
go to Visibility Timeout. For more information about different queue attributes you can set, go to
SetQueueAttributes.
2. After you create the request, pass it as a parameter to the CreateQueue method.The method returns
a CreateQueueResponse object, as follows:
CreateQueueResponse createQueueResponse =
amazonSQSClient.CreateQueue(createQueueRequest);
For information about how queues work in Amazon SQS, go to How SQS Queues Work.
For information about your queue URL, see Amazon SQS Queue URLs (p. 60).
Amazon SQS Queue URLs
You require the queue URL to send, receive, and delete queue messages. A queue URL is constructed
in the following format:
https://queue.amazonaws.com/YOUR_ACCOUNT_NUMBER/YOUR_QUEUE_NAME
To find your AWS account number, go to Security Credentials .Your account number is located under
Account Number in the upper right of the page.
For information on sending a message to a queue, see Send an Amazon SQS Message (p. 60).
For information about receiving messages from a queue, see Receive a Message from an Amazon SQS
Queue (p. 61).
For information about deleting messages from a queue, see Delete a Message from an Amazon SQS
Queue (p. 62).
Send an Amazon SQS Message
You can use the Amazon SDK for .NET to send a message to an Amazon SQS queue.
Version v2.0.0
60
AWS SDK for .NET Developer Guide
Amazon SQS Queue URLs