class PubsubMessage extends Message

A message data and its attributes. The message payload must not be empty; it must contain either a non-empty data field, or at least one attribute.

Protobuf type Google\Pubsub\V1\PubsubMessage

Methods

__construct()

No description

string
getData()

The message payload.

setData(string $var)

The message payload.

RepeatedField
getAttributes()

Optional attributes for this message.

setAttributes(array|RepeatedField $var)

Optional attributes for this message.

string
getMessageId()

ID of this message, assigned by the server when the message is published.

setMessageId(string $var)

ID of this message, assigned by the server when the message is published.

getPublishTime()

The time at which the message was published, populated by the server when it receives the Publish call. It must not be populated by the publisher in a Publish call.

setPublishTime(Timestamp $var)

The time at which the message was published, populated by the server when it receives the Publish call. It must not be populated by the publisher in a Publish call.

Details

at line 49
__construct()

at line 60
string getData()

The message payload.

Generated from protobuf field bytes data = 1;

Return Value

string

at line 71
setData(string $var)

The message payload.

Generated from protobuf field bytes data = 1;

Parameters

string $var

at line 83
RepeatedField getAttributes()

Optional attributes for this message.

Generated from protobuf field map<string, string> attributes = 2;

Return Value

RepeatedField

at line 94
setAttributes(array|RepeatedField $var)

Optional attributes for this message.

Generated from protobuf field map<string, string> attributes = 2;

Parameters

array|RepeatedField $var

at line 109
string getMessageId()

ID of this message, assigned by the server when the message is published.

Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a PubsubMessage via a Pull call or a push delivery. It must not be populated by the publisher in a Publish call.

Generated from protobuf field string message_id = 3;

Return Value

string

at line 123
setMessageId(string $var)

ID of this message, assigned by the server when the message is published.

Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a PubsubMessage via a Pull call or a push delivery. It must not be populated by the publisher in a Publish call.

Generated from protobuf field string message_id = 3;

Parameters

string $var

at line 137
Timestamp getPublishTime()

The time at which the message was published, populated by the server when it receives the Publish call. It must not be populated by the publisher in a Publish call.

Generated from protobuf field .google.protobuf.Timestamp publish_time = 4;

Return Value

Timestamp

at line 150
setPublishTime(Timestamp $var)

The time at which the message was published, populated by the server when it receives the Publish call. It must not be populated by the publisher in a Publish call.

Generated from protobuf field .google.protobuf.Timestamp publish_time = 4;

Parameters

Timestamp $var