# Dead Letter Queues

* **If a message can't be consumed successfully**, you can send it to a dead-letter queue (DLQ).<br>
* Dead-letter queues **let you isolate problematic messages to determine why they are failing**.<br>
* The **`Maximum receives` value determines when a message will be sent to the DLQ**.<br>
* Dead-letter queues are **useful for debugging your application or messaging system**.

## How do dead-letter queues work?

* **Sometimes, messages can’t be processed** because of a variety of possible issues, such as erroneous conditions within the producer or consumer application.<br>
* For example, if a user places a **web order with a particular product ID, but the product ID is deleted, the web store's code fails** and displays an error, and the **message with the order request is sent to a dead-letter queue**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://karansingh.gitbook.io/aws-saa-c02/simple-queue-service-sqs/dead-letter-queues.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
