delete_message ( $queue_url, $receipt_handle, $opt )

The DeleteMessage action unconditionally removes the specified message from the specified queue. Even if the message is locked by another reader due to the visibility timeout setting, it is still deleted from the queue.

Access

public

Parameters

Parameter

Type

Required

Description

$queue_url

string

Required

The URL of the SQS queue to take action on.

$receipt_handle

string

Required

The receipt handle associated with the message to delete.

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Delete a message from a queue.

// Delete a message we've read
$sqs = new AmazonSQS();
$response = $sqs->delete_message('example-queue', '0NNAq8PwvXvg8EfAYG9sSmwKTZeixZgZNE6PbodG8td0DJ3gVOmjI2Gh/oFnb0=');

// Success?
var_dump($response->isOK());
Result:
bool(true)

Related Methods

Source

Method defined in services/sqs.class.php | Toggle source view (8 lines) | View on GitHub

public function delete_message($queue_url, $receipt_handle, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['QueueUrl'] = $queue_url;
    $opt['ReceiptHandle'] = $receipt_handle;
    
    return $this->authenticate('DeleteMessage', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback