> ## Documentation Index
> Fetch the complete documentation index at: https://cloud-architect.ipoint-labs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction SQS DeadLetter Queue

> Hands-on lab · 30m

Launch this lab in the IP Lab Portal, then follow the steps below in the AWS console.

<a className="ip-lab-portal-btn" href="https://labs.intellectualpoint.com/labs/introduction-sqs-deadletter-queue" target="_blank" rel="noreferrer">
  Open IP Lab Portal
</a>

## Overview

### Lab details

1. This lab will walk you through the steps to create and understand SQS Dead-Letter Queues in the context of Amazon Simple Queue Service in AWS.

2. Duration: **45 minutes**

3. AWS Region: **US East (N. Virginia) us-east-1.**

### Introduction

#### What is SQS Dead-Letter Queue

1. SQS Dead Letter Queue (DLQ) is a feature in Amazon SQS designed for handling messages that repeatedly fail processing.

2. Messages are moved to the DLQ after a configured maximum number of processing attempts, preventing infinite processing loops.

3. Users can configure parameters such as MaximumReceives to control when messages are moved to the DLQ.

4. Failed messages are isolated in the DLQ, allowing developers to analyze and troubleshoot processing issues without affecting the main queue.

5. DLQ supports automatic retries, attempting to process failed messages again and moving them back to the main queue under specified conditions.

6. Integration with AWS CloudWatch enables monitoring of the DLQ, and notifications can be set up to alert administrators when messages are moved to the Dead Letter Queue.

#### Architecture diagram

<img src="https://mintcdn.com/ip-cloud-architect-pathway/S7TRbFaK099mvCQ6/images/labs/introduction-sqs-deadletter-queue/001.png?fit=max&auto=format&n=S7TRbFaK099mvCQ6&q=85&s=1ab69bb8b1b4aacb10776f7ab1dc0054" alt="" width="1600" height="1234" data-path="images/labs/introduction-sqs-deadletter-queue/001.png" />

### Task details

1. Sign in to the AWS Management Console.

2. Create SQS Dead-Letter Queues.

3. Send and Receive Messages

4. Validation Of The Lab.

### Launching the lab environment

1. To launch the lab environment, Click on the **Launch lab** button.

2. Please wait until the cloud environment is provisioned. It will take less than a minute to provision.

3. Once the Lab is started, you will be provided with **IAM username**, **Password**, **Access** **Key**, and **Secret** **Access** **Key**.

**Note** : You can only start one lab at any given time

## Lab guide

### Lab steps

#### Task 1: Sign in to AWS Management Console

1. Click on the **Open console** button, and you will get redirected to AWS Console in a new browser tab.

2. On the AWS sign-in page,

* Leave the Account ID as default. Never edit/remove the 12-digit Account ID present in the AWS Console. Otherwise, you cannot proceed with the lab.
* Now copy your **User Name** and **Password** in the Lab Console to the **IAM Username and Password** in AWS Console and click on the **Sign in** button.

3. Once Signed In to the AWS Management Console, make the default AWS Region as **US East (N. Virginia) us-east-1**.

Note : If you face any issues, please go through [FAQs and Troubleshooting](/aws-cp/support/faqs-and-troubleshooting).

#### Task 2 : Create SQS Dead-letter Queues

In this task, we are going to create a Dead-Letter queue and a primary testing queue.

1. Make sure you are in the **N. Virginia** region.

2. Navigate to the **Services** menu on the top, search for **SQS** and select it.

3. Click on the **Create queue** button.

4. Details :

   * Type : Select **Standard**
   * Name : Enter **WhizQueue**.

5. Configurations:

* Message retenation period : Enter **14** Days

<img src="https://mintcdn.com/ip-cloud-architect-pathway/S7TRbFaK099mvCQ6/images/labs/introduction-sqs-deadletter-queue/002.png?fit=max&auto=format&n=S7TRbFaK099mvCQ6&q=85&s=800268e159a47c49c5cebe882ca09ed5" alt="" width="1600" height="956" data-path="images/labs/introduction-sqs-deadletter-queue/002.png" />

6. Leave everything as **default** and click on **Create queue** button

7. Once you click on **Create Queue**, you will get a success message.

8. Now, We’ll create a **Primary Queue**, with all the default options and assign previously created queue with primary queue.

9. Click on **Create queue** button.

10. **Details** :

* Type : Select **Standard**
* Name : Enter **TestQueue**

<img src="https://mintcdn.com/ip-cloud-architect-pathway/S7TRbFaK099mvCQ6/images/labs/introduction-sqs-deadletter-queue/003.png?fit=max&auto=format&n=S7TRbFaK099mvCQ6&q=85&s=08c89d01608edc2226919bfd5df0ed43" alt="" width="1600" height="634" data-path="images/labs/introduction-sqs-deadletter-queue/003.png" />

11. Dead-letter queue : Select **Enabled**

* Choose queue : Select **WhizQueue** arn
* Maximum receives : Enter **1**

<img src="https://mintcdn.com/ip-cloud-architect-pathway/S7TRbFaK099mvCQ6/images/labs/introduction-sqs-deadletter-queue/004.png?fit=max&auto=format&n=S7TRbFaK099mvCQ6&q=85&s=a4b14edd653e40d38fafc464a1f4bdb9" alt="" width="1600" height="725" data-path="images/labs/introduction-sqs-deadletter-queue/004.png" />

12. Click on the **Create queue** button.

#### Task 3 : Send and Receive Messages

1. We’ll be now sending a message from our Testing queue.

2. Click on **Send and receive messages** button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/S7TRbFaK099mvCQ6/images/labs/introduction-sqs-deadletter-queue/005.png?fit=max&auto=format&n=S7TRbFaK099mvCQ6&q=85&s=9a86573dcacb71ab3fcb33dca63b9612" alt="" width="1600" height="516" data-path="images/labs/introduction-sqs-deadletter-queue/005.png" />

3. Send message

* Message body : Enter **My first queue message**

<img src="https://mintcdn.com/ip-cloud-architect-pathway/S7TRbFaK099mvCQ6/images/labs/introduction-sqs-deadletter-queue/006.png?fit=max&auto=format&n=S7TRbFaK099mvCQ6&q=85&s=f4bd0eb989a764dea4d7dc3ba01a4adc" alt="" width="1600" height="446" data-path="images/labs/introduction-sqs-deadletter-queue/006.png" />

4. Now click on **Send message** button

5. Once you have sent a message, you get an acknowledgment.

6. After sending the message, we can see that **Messages available** changes to 1.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/S7TRbFaK099mvCQ6/images/labs/introduction-sqs-deadletter-queue/007.png?fit=max&auto=format&n=S7TRbFaK099mvCQ6&q=85&s=ea3db799220b8c9e1ac152e595ec7843" alt="" width="413" height="191" data-path="images/labs/introduction-sqs-deadletter-queue/007.png" />

7. Now, to get all the messages we have sent, click on **Poll for messages** in the **Receive messages section**.

8. We can now see the message column has been filled with the messages.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/S7TRbFaK099mvCQ6/images/labs/introduction-sqs-deadletter-queue/008.png?fit=max&auto=format&n=S7TRbFaK099mvCQ6&q=85&s=c3465656a037383854f8fa723ca53a8f" alt="" width="1600" height="380" data-path="images/labs/introduction-sqs-deadletter-queue/008.png" />

9. Then click on the message to see its body.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/S7TRbFaK099mvCQ6/images/labs/introduction-sqs-deadletter-queue/009.png?fit=max&auto=format&n=S7TRbFaK099mvCQ6&q=85&s=fb299e0aff78042885612734b9e6902b" alt="" width="1600" height="610" data-path="images/labs/introduction-sqs-deadletter-queue/009.png" />

10. Now, try to click on poll for messages again. You will see the messages available will become **0**.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/S7TRbFaK099mvCQ6/images/labs/introduction-sqs-deadletter-queue/010.png?fit=max&auto=format&n=S7TRbFaK099mvCQ6&q=85&s=e5dc13db17283d2bdbbee5a36b2760f4" alt="" width="1600" height="224" data-path="images/labs/introduction-sqs-deadletter-queue/010.png" />

11. As we received the message once and added the received count to **1** limit to the **TestQueue** this time the message we polled has been moved into the **WhizQueue**.

12. Now, let's navigate to the Queue Dashboard and check the message available count in both queues.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/S7TRbFaK099mvCQ6/images/labs/introduction-sqs-deadletter-queue/011.png?fit=max&auto=format&n=S7TRbFaK099mvCQ6&q=85&s=7051d60a18c745d93c43fd97c143d81a" alt="" width="1600" height="312" data-path="images/labs/introduction-sqs-deadletter-queue/011.png" />

13. You will notice the message availability in **WhizQueue** is **1** and **TestQueue** as **0** message available.

14. Let’s click on **WhizQueue** to check the message and click on **Send and receive messages**. Now, to get the message, click on **Poll for messages** in the **Receive messages** section.

15. Also notice the **receive count** which is **2** that means it is same message which we received on **TestQueue**.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/S7TRbFaK099mvCQ6/images/labs/introduction-sqs-deadletter-queue/012.png?fit=max&auto=format&n=S7TRbFaK099mvCQ6&q=85&s=27e327607f73a2f002314c2534c71de1" alt="" width="1600" height="447" data-path="images/labs/introduction-sqs-deadletter-queue/012.png" />

16. To verify the **message** click on the messages to see its body you will see the message body as same which we send previously.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/S7TRbFaK099mvCQ6/images/labs/introduction-sqs-deadletter-queue/013.png?fit=max&auto=format&n=S7TRbFaK099mvCQ6&q=85&s=6357d0ccff0897ffac7a1537321c3176" alt="" width="1600" height="610" data-path="images/labs/introduction-sqs-deadletter-queue/013.png" />

<Tip>
  **Do you know?**

  The Dead Letter Queue acts as a safety net, preventing messages from being stuck in infinite processing loops. It allows developers to set a maximum number of processing attempts (configured as MaximumReceives) for each message. If a message exceeds this limit without being successfully processed, it is automatically moved to the Dead Letter Queue.
</Tip>

#### Task 4 : Validation Test

1. Once The Lab Steps Are Completed, Please Click On the **Check my work** button On The Right Side Panel.
2. This Will Validate The Resources In The AWS Account And Shows You Whether You Have Completed This Lab Successfully Or Not.
3. Sample Output :

<img src="https://mintcdn.com/ip-cloud-architect-pathway/S7TRbFaK099mvCQ6/images/labs/introduction-sqs-deadletter-queue/014.gif?s=68bd81ce1cdf6b56ab823685b5339f31" alt="" width="1000" height="566" data-path="images/labs/introduction-sqs-deadletter-queue/014.gif" />

### Completion and conclusion

1. You have successfully created dead-letter queue

2. You have successfully received the message in dead-letter queue.

### End lab

1. Sign out of the AWS Account.

2. You have successfully completed the lab.

3. Once you have completed the steps, click on End Lab from your whizlab’s dashboard.

## What gets checked

When you press **Check my work**, the platform verifies each of these:

* **Create SQS Standard Dead Letter Queue** — Check whether a Standard SQS Dead Letter Queue is created or not.
* **Create Standard SQS Queue** — Check whether a Standard SQS Queue is created or not.

## Related help

* [FAQs and Troubleshooting](/aws-cp/support/faqs-and-troubleshooting)
