Menu
Amazon Simple Queue Service
Developer Guide

Getting Started with Amazon SQS

This section will help you become more familiar with Amazon SQS by showing you how to manage queues and messages using the AWS Management Console.

Note

The Amazon Simple Queue Service Getting Started Guide has been retired. If you want to work with Amazon SQS programmatically, see the Amazon SQS Tutorials and Working with Amazon SQS APIs sections.

Prerequisites

Before you begin, complete the steps in Setting Up Amazon SQS.

Step 1: Create a Queue

The first and most common Amazon SQS task is creating queues. The following example demonstrates how to create and configure a queue.

  1. Sign in to the AWS Management Console and open the Amazon SQS console at https://console.aws.amazon.com/sqs/.

  2. Choose Create New Queue.

  3. On the Create New Queue page, ensure that you're in the correct region and then type the Queue Name.

    Note

    The name of a FIFO queue must end with the .fifo suffix. FIFO queues are available in US West (Oregon) and US East (Ohio).

  4. Standard is selected by default. Choose FIFO.

  5. To create your queue with the default parameters, choose Quick-Create Queue.

    Your new queue is created and selected in the queue list.

    Note

    When you create a queue, it can take a short time for the queue to propagate throughout Amazon SQS..

    The Queue Type column helps you distinguish standard queues from FIFO queues at a glance. For a FIFO queue, the Content-Based Deduplication column displays whether you have enabled exactly-once processing.

    Your queue's URL and ARN are displayed on the Details tab.

Step 2: Send a Message

After you create your queue, you can send a message to it. The following example demonstrates sending a message to an existing queue.

  1. From the queue list, select the queue that you've created.

  2. From the Queue Actions drop-down list, select Send a Message.

    The Send a Message to QueueName dialog box is displayed.

    The following example shows the Message Group ID and Message Deduplication ID parameters specific to FIFO queues (content-based deduplication is disabled).

  3. To send a message to a FIFO queue, type the Message Body, the Message Group ID MyMessageGroupId1234567890, and the Message Deduplication ID MyMessageDeduplicationId1234567890, and then choose Send Message. For more information, see FIFO Queue Logic.

    Note

    The message group ID is always required. However, if content-based deduplication is enabled, the message deduplication ID is optional.

    Your message is sent and the Send a Message to QueueName dialog box is displayed, showing the attributes of the sent message.

    The following example shows the Sequence Number attribute specific to FIFO queues.

  4. Choose Close.

Step 3: Receive and Delete a Message

After you send a message into a queue, you can consume it (retrieve it from the queue). When you request a message from a queue, you can't specify which message to get. Instead, you specify the maximum number of messages (up to 10) that you want to get.

The following example demonstrates receiving and deleting a message.

  1. From the queue list, select the queue that you have created.

  2. From the Queue Actions drop-down list, select View/Delete Messages.

    The View/Delete Messages in QueueName dialog box is displayed.

    Note

    The first time you take this action, an information screen is displayed. To hide the screen, check the Don't show this again checkbox.

  3. Choose Start Polling for messages.

    Amazon SQS begins to poll the messages in the queue. The dialog box displays a message from the queue. A progress bar at the bottom of the dialog box displays the status of the message's visibility timeout.

    The following example shows the Message Group ID, Message Deduplication ID, and Sequence Number columns specific to FIFO queues.

  4. Before the visibility timeout expires, select the message that you want to delete and then choose Delete 1 Message.

    The Delete Messages dialog box is displayed.

  5. Confirm that the message you want to delete is checked and choose Yes, Delete Checked Messages.

    The selected message is deleted.

    When the progress bar is filled in, the visibility timeout expires and the message becomes visible to consumers.

  6. Select Close.

Step 4: Delete a Queue

If you don't use an Amazon SQS queue (and don't foresee using it in the near future), it is a best practice to delete it from Amazon SQS. The following example demonstrates deleting a queue.

  1. From the queue list, select the queue that you have created.

  2. From the Queue Actions drop-down list, select Delete Queue.

    The Delete Queues dialog box is displayed.

  3. Choose Yes, Delete Queue.

    The queue is deleted.

Next Steps

Now that you've created a queue and learned how to send, receive, and delete messages and how to delete a queue, you might want to try the following: