A message that is published by publishers and consumed by subscribers. The message must contain either a non-empty data field or at least one attribute. Note that client libraries represent this object differently depending on the language. See the correspondingclient library documentationfor more information. Seequotas and limitsfor more information about message limits.
Fields
data
bytes
The message data field. If this field is empty, the message must contain at least one attribute.
attributes
map<string, string>
Attributes for this message. If this field is empty, the message must contain non-empty data. This can be used to filter messages on the subscription.
message_id
string
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 aPubsubMessagevia aPullcall or a push delivery. It must not be populated by the publisher in aPublishcall.
The time at which the message was published, populated by the server when it receives thePublishcall. It must not be populated by the publisher in aPublishcall.
ordering_key
string
If non-empty, identifies related messages for which publish order should be respected. If aSubscriptionhasenable_message_orderingset totrue, messages published with the same non-emptyordering_keyvalue will be delivered to subscribers in the order in which they are received by the Pub/Sub system. AllPubsubMessages published in a givenPublishRequestmust specify the sameordering_keyvalue.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-23 UTC."],[],[],null,["# Package google.pubsub.v1\n\nIndex\n-----\n\n- [PubsubMessage](/scheduler/docs/reference/rpc/google.pubsub.v1#google.pubsub.v1.PubsubMessage) (message)\n\nPubsubMessage\n-------------\n\nA message that is published by publishers and consumed by subscribers. The message must contain either a non-empty data field or at least one attribute. Note that client libraries represent this object differently depending on the language. See the corresponding [client library documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for more information. See [quotas and limits](https://cloud.google.com/pubsub/quotas) for more information about message limits."]]