When you create a queue, it can take a short time for the queue to propagate throughout the SQS system. You can confirm the queue's existence by listing the queues you have in SQS. The following code snippets list the queues you've created using the 2008-01-01 version of SQS.
![]() | Note |
|---|---|
The WSDL version you use for the request affects which queues are included in the response. Before the release of version 2008-01-01, you could use either of the available versions (2007-05-01 or 2006-04-01) for your If you're now using one or both of the old versions and the 2008-01-01 version to create queues, you can't get a list of all your queues with a single call to |
To run the sample
Open ListQueuesSample.java.
Remove any comment marks from the invokeListQueues(service, request);
line.
Compile and run the sample.
Amazon SQS returns the list of the queues you've created using the 2008-01-01 version of Amazon SQS, including the newly created MyQueue queue. Each queue is identified by its queue URL. The response also includes the request ID Amazon SQS assigned to your request.
To run the sample
Open AmazonSQSSamples.cs.
Comment out the code you added in the preceding section (that code consisted of the following lines).
CreateQueueRequest request = new CreateQueueRequest(); request.QueueName = "MyQueue"; CreateQueueSample.InvokeCreateQueue(service, request);
Locate the following lines.
// ListQueuesRequest request = new ListQueuesRequest(); // @TODO: set request parameters here // ListQueuesSample.InvokeListQueues(service, request);
Remove the comment marks from those lines of code and delete the @TODO: set
request parameters here line.
Run the sample.
Amazon SQS returns the list of the queues you've created using the 2008-01-01 version of Amazon SQS, including the newly created MyQueue queue. Each queue is identified by its queue URL. The response also includes the request ID Amazon SQS assigned to your request.
To run the sample
Open ListQueuesSample.pl.
Locate the following line.
# invokeListQueues($service, $request);
Replace the line with the following new lines of code.
my $request = Amazon::SQS::Model::ListQueuesRequest->new(); invokeListQueues($service, $request);
Run the sample.
Amazon SQS returns the list of the queues you've created using the 2008-01-01 version of Amazon SQS, including the newly created MyQueue queue. Each queue is identified by its queue URL. The response also includes the request ID Amazon SQS assigned to your request.
To run the sample
Open ListQueuesSample.php.
Locate the following line.
// invokeListQueues($service, $request);
Replace the line with the following new lines of code.
require_once ('Amazon/SQS/Model/ListQueuesRequest.php');
$request = new Amazon_SQS_Model_ListQueuesRequest();
invokeListQueues($service, $request);
Run the sample.
Amazon SQS returns the list of the queues you've created using the 2008-01-01 version of Amazon SQS, including the newly created MyQueue queue. Each queue is identified by its queue URL. The response also includes the request ID Amazon SQS assigned to your request.
To run the sample
Open AmazonSQSSamples.vb.
Comment out the code you added in the preceding section (that code consisted of the following lines).
Dim request As New CreateQueueRequest() request.QueueName = "MyQueue" CreateQueueSample.InvokeCreateQueue(service, request)
Locate the following lines.
' Dim request As New ListQueuesRequest() ' @TODO: set request parameters here ' ListQueuesSample.InvokeListQueues(service, request)
Remove the comment marks from those lines of code and delete the @TODO: set
request parameters here line.
Run the sample.
Amazon SQS returns the list of the queues you've created using the 2008-01-01 version of Amazon SQS, including the newly created MyQueue queue. Each queue is identified by its queue URL. The response also includes the request ID Amazon SQS assigned to your request.
To run the sample
In the scratchpad, select ListQueues from the Explore API list box.
Leave the Queue Name Prefix field blank.
Select one of the following:
To invoke the request, click Invoke Request. Amazon SQS returns a response.
To view the signed URL, click Display Signed URL. Then, copy and paste the signed URL into a browser. Amazon SQS returns a response.
To view the string to sign, click Display String to Sign.