Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Amazonka.SQS.DeleteMessage
Description
Deletes the specified message from the specified queue. To select the
message to delete, use the ReceiptHandle
of the message (not the
MessageId
which you receive when you send the message). Amazon SQS can
delete a message from a queue even if a visibility timeout setting
causes the message to be locked by another consumer. Amazon SQS
automatically deletes messages left in a queue longer than the retention
period configured for the queue.
The ReceiptHandle
is associated with a specific instance of
receiving a message. If you receive a message more than once, the
ReceiptHandle
is different each time you receive a message. When you
use the DeleteMessage
action, you must provide the most recently
received ReceiptHandle
for the message (otherwise, the request
succeeds, but the message might not be deleted).
For standard queues, it is possible to receive a message even after you delete it. This might happen on rare occasions if one of the servers which stores a copy of the message is unavailable when you send the request to delete the message. The copy remains on the server and might be returned to you during a subsequent receive request. You should ensure that your application is idempotent, so that receiving a message more than once does not cause issues.
Synopsis
- data DeleteMessage = DeleteMessage' {
- queueUrl :: Text
- receiptHandle :: Text
- newDeleteMessage :: Text -> Text -> DeleteMessage
- deleteMessage_queueUrl :: Lens' DeleteMessage Text
- deleteMessage_receiptHandle :: Lens' DeleteMessage Text
- data DeleteMessageResponse = DeleteMessageResponse' {
- newDeleteMessageResponse :: DeleteMessageResponse
Creating a Request
data DeleteMessage Source #
See: newDeleteMessage
smart constructor.
Constructors
DeleteMessage' | |
Fields
|
Instances
Arguments
:: Text | |
-> Text | |
-> DeleteMessage |
Create a value of DeleteMessage
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:queueUrl:DeleteMessage'
, deleteMessage_queueUrl
- The URL of the Amazon SQS queue from which messages are deleted.
Queue URLs and names are case-sensitive.
$sel:receiptHandle:DeleteMessage'
, deleteMessage_receiptHandle
- The receipt handle associated with the message to delete.
Request Lenses
deleteMessage_queueUrl :: Lens' DeleteMessage Text Source #
The URL of the Amazon SQS queue from which messages are deleted.
Queue URLs and names are case-sensitive.
deleteMessage_receiptHandle :: Lens' DeleteMessage Text Source #
The receipt handle associated with the message to delete.
Destructuring the Response
data DeleteMessageResponse Source #
See: newDeleteMessageResponse
smart constructor.
Constructors
DeleteMessageResponse' | |
Instances
newDeleteMessageResponse :: DeleteMessageResponse Source #
Create a value of DeleteMessageResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.