Amazon Simple Queue Service (SQS) - Hands On Demo

Creating an Amazon SQS standard queue and sending a message

 

  1. Open the Amazon SQS console at https://console.aws.amazon.com/sqs/.

  2. Choose Create queue.

  3. For Type, the Standard queue type is set by default.

    Note

    You can't change the queue type after you create the queue.

  4. Enter a Name for your queue.

  5. (Optional) The console sets default values for the queue configuration parameters. Under Configuration, you can set new values for the following parameters:

    1. For Visibility timeout , enter the duration and units. The range is from 0 seconds to 12 hours. The default value is 30 seconds.

    2. For Message retention period, enter the duration and units. The range is from 1 minute to 14 days. The default value is 4 days.

    3. For Delivery delay, enter the duration and units. The range is from 0 seconds to 15 minutes. The default value is 0 seconds.

    4. For Maximum message size, enter a value. The range is from 1 KB to 256 KB. The default value is 256 KB.

    5. For Receive message wait time, enter a value. The range is from 0 to 20 seconds. The default value is 0 seconds, which sets short polling. Any non-zero value sets long polling.

 

 

My-First-SQS-Queue
  1. (Optional) Define an Access policy. The access policy defines the accounts, users, and roles that can access the queue. The access policy also defines the actions (such as SendMessage, ReceiveMessage, or DeleteMessage) that the users can access. The default policy allows only the queue owner to send and receive messages.

    To define the access policy, do one of the following:

    • Choose Basic to configure who can send messages to the queue and who can receive messages from the queue. The console creates the policy based on your choices and displays the resulting access policy in the read-only JSON panel.

    • Choose Advanced to modify the JSON access policy directly. This allows you to specify a custom set of actions that each principal (account, user, or role) can perform.

  2. For Redrive allow policy, choose Enabled. Select one of the following: Allow all, By queue, or Deny all. When choosing By queue, specify a list of up to 10 source queues by the Amazon Resource Name (ARN).

  3. Amazon SQS provides managed server-side encryption by default. To choose an encryption key type, or to disable Amazon SQS managed server-side encryption, expand Encryption.

  4. (Optional) To configure a dead-letter queue to receive undeliverable messages, expand Dead-letter queue.

  5. (Optional) To add tags to the queue, expand Tags.

  6. Choose Create queue. Amazon SQS creates the queue and displays the queue's Details page.

Send a message

After you create your queue, you can send a message to it.

  1. From the left navigation pane, choose Queues. From the queue list, select the queue that you created.

  2. From Actions, choose Send and receive messages.

    The console displays the Send and receive messages page.

  3. In the Message body, enter the message text.

  4. For a standard queue, you can enter a value for Delivery delay and choose the units. For example, enter 60 and choose seconds

  5. Choose Send message.

    When your message is sent, the console displays a success message. Choose View details to display information about the sent message.

My-First-SQS-Queue Message

Receive a message

After you create your queue, you can receive a message to it.

  1. From the left navigation pane, choose Queues. From the queue list, select the queue that you created.

  2. From Actions, choose Send and receive messages.

    The console displays the Send and receive messages page.

  3. Under Receive messages section, click Poll for messages.

  4. Click on message ID to see the message that you have just sent.

To create an Amazon SQS FIFO queue
  1. Choose Create queue.

  2. For Type, the Standard queue type is set by default. To create a FIFO queue, choose FIFO.

  3. Note: You can't change the queue type after you create the queue.

  4. Enter a Name for your queue.

    The name of a FIFO queue must end with the .fifo suffix. The suffix counts towards the 80-character queue name quota. To determine whether a queue is FIFO, you can check whether the queue name ends with the suffix.

My-First-Fifo-Queue.fifo
  1. (Optional) The console sets default values for the queue configuration parameters. Under Configuration, you can set new values for the following parameters:
  2. For Visibility timeout , enter the duration and units. The range is from 0 seconds to 12 hours. The default value is 30 seconds.
  3. For Message retention period, enter the duration and units. The range is from 1 minute to 14 days. The default value is 4 days.
  4. For Delivery delay, enter the duration and units. The range is from 0 seconds to 15 minutes. The default value is 0 seconds.
  5. For Maximum message size, enter a value. The range is from 1 KB to 256 KB. The default value is 256 KB.
  6. For Receive message wait time, enter a value. The range is from 0 to 20 seconds. The default value is 0 seconds, which sets short polling. Any non-zero value sets long polling.
  7. For a FIFO queue, choose Content-based deduplication to enable content-based deduplication. The default setting is disabled.
  8. (Optional) For a FIFO queue to enable higher throughput for sending and receiving messages in the queue, choose Enable high throughput FIFO.
  9. Choosing this option changes the related options (Deduplication scope and FIFO throughput limit) to the required settings for enabling high throughput for FIFO queues. If you change any of the settings required for using high throughput FIFO, normal throughput is in effect for the queue, and deduplication occurs as specified. 
  1. (Optional) Define an Access policy. The access policy defines the accounts, users, and roles that can access the queue. The access policy also defines the actions (such as SendMessage, ReceiveMessage, or DeleteMessage) that the users can access. The default policy allows only the queue owner to send and receive messages.

    To define the access policy, do one of the following:

    • Choose Basic to configure who can send messages to the queue and who can receive messages from the queue. The console creates the policy based on your choices and displays the resulting access policy in the read-only JSON panel.

    • Choose Advanced to modify the JSON access policy directly. This allows you to specify a custom set of actions that each principal (account, user, or role) can perform.

  2. For Redrive allow policy, choose Enabled. Select one of the following: Allow all, By queue, or Deny all. When choosing By queue, specify a list of up to 10 source queues by the Amazon Resource Name (ARN).

  3. Amazon SQS provides managed server-side encryption by default. 

  4. (Optional) To configure a dead-letter queue to receive undeliverable messages, expand Dead-letter queue.

  5. (Optional) To add tags to the queue, expand Tags.

    • Choose Create queue. Amazon SQS creates the queue and displays the queue's Details page.

Send a message

 

  1. From the left navigation pane, choose Queues. From the queue list, select the queue that you created.

  2. From Actions, choose Send and receive messages.

    The console displays the Send and receive messages page.

  3. In the Message body, enter the message text.

  4. For a First-In-First-Out (FIFO) queue, enter a Message group ID

  5. For a FIFO queue, you can enter a Message deduplication ID.

  6. FIFO queues does not support timers on individual messages.

  7. Choose Send message.

    When your message is sent, the console displays a success message. Choose View details to display information about the sent message.

My-First-Fifo-Queue.fifo Message

Receive a message

After you create your queue, you can receive a message to it.

  1. From the left navigation pane, choose Queues. From the queue list, select the queue that you created.

  2. From Actions, choose Send and receive messages.

    The console displays the Send and receive messages page.

  3. Under Receive messages section, click Poll for messages.

  4. Click on message ID to see the message that you have just sent.

Thanks

For

Watching