send_message_batch ( $queue_url, $send_message_batch_request_entry, $opt )

This is a batch version of SendMessage. It takes multiple messages and adds each of them to the queue. The result of each add operation is reported individually in the response.

Access

public

Parameters

Parameter

Type

Required

Description

$queue_url

string

Required

The URL of the SQS queue to take action on.

$send_message_batch_request_entry

array

Required

A list of SendMessageBatchRequestEntry s.

  • x - array - Optional - This represents a simple array index.
    • Id - string - Required - An identifier for the message in this batch. This is used to communicate the result. Note that the the Id s of a batch request need to be unique within the request.
    • MessageBody - string - Required - Body of the message.
    • DelaySeconds - integer - Optional - The number of seconds for which the message has to be delayed.

$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.

Source

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

public function send_message_batch($queue_url, $send_message_batch_request_entry, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['QueueUrl'] = $queue_url;
    
    // Required list + map
    $opt = array_merge($opt, CFComplexType::map(array(
        'SendMessageBatchRequestEntry' => (is_array($send_message_batch_request_entry) ? $send_message_batch_request_entry : array($send_message_batch_request_entry))
    )));

    return $this->authenticate('SendMessageBatch', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback