| Did this page help you? Yes No Tell us about it... |
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 2009-02-01 version of SQS.
The AWS Management Console displays a list of your queues for the region you have selected. By default, the console displays the US East region.
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.
To run the sample
Open SimpleQueueServiceSample.java.
The following section of the code lists your queues:
// List queues
System.out.println("Listing all queues in your account.\n");
for (String queueUrl : sqs.listQueues().getQueueUrls()) {
System.out.println(" QueueUrl: " + queueUrl);
}
System.out.println();Compile and run the sample.
Amazon SQS returns the list of the queues you've created using the 2009-02-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 Program.cs.
The following section of the code lists your queues:
//Confirming the queue exists
ListQueuesRequest listQueuesRequest = new ListQueuesRequest();
ListQueuesResponse listQueuesResponse = sqs.ListQueues(listQueuesRequest);
Console.WriteLine("Printing list of Amazon SQS queues.\n");
if (listQueuesResponse.IsSetListQueuesResult())
{
ListQueuesResult listQueuesResult = listQueuesResponse.ListQueuesResult;
foreach (String queueUrl in listQueuesResult.QueueUrl)
{
Console.WriteLine(" QueueUrl: {0}", queueUrl);
}
}
Console.WriteLine();Run the sample.
Amazon SQS returns the list of the queues you've created using the 2009-02-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 2009-02-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 2009-02-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.