Example:
$topic->publishBatch([
[
'data' => 'New User Registered',
'attributes' => [
'id' => 1,
'userName' => 'John',
'location' => 'Detroit'
]
], [
'data' => 'New User Registered',
'attributes' => [
'id' => 2,
'userName' => 'Steve',
'location' => 'Mountain View'
]
]
]);
public publishBatch ( array $messages, array $options = [] ) : array | ||
$messages | array | A list of messages. Each message must be in the correct [Message Format](https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage). If provided, $data will be base64 encoded before being published, unless `$options['encode']` is set to false. (See below for more information.) } |
$options | array | [optional] Configuration Options |
return | array | A list of message IDs. |