public final class PubsubMessage extends com.google.protobuf.GeneratedMessageV3 implements PubsubMessageOrBuilder
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 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.Protobuf type
google.pubsub.v1.PubsubMessage| Modifier and Type | Class and Description |
|---|---|
static class |
PubsubMessage.Builder
A message that is published by publishers and consumed by subscribers.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
ATTRIBUTES_FIELD_NUMBER |
static int |
DATA_FIELD_NUMBER |
static int |
MESSAGE_ID_FIELD_NUMBER |
static int |
ORDERING_KEY_FIELD_NUMBER |
static int |
PUBLISH_TIME_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsAttributes(String key)
Attributes for this message.
|
boolean |
equals(Object obj) |
Map<String,String> |
getAttributes()
Deprecated.
|
int |
getAttributesCount()
Attributes for this message.
|
Map<String,String> |
getAttributesMap()
Attributes for this message.
|
String |
getAttributesOrDefault(String key,
String defaultValue)
Attributes for this message.
|
String |
getAttributesOrThrow(String key)
Attributes for this message.
|
com.google.protobuf.ByteString |
getData()
The message data field.
|
static PubsubMessage |
getDefaultInstance() |
PubsubMessage |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
String |
getMessageId()
ID of this message, assigned by the server when the message is published.
|
com.google.protobuf.ByteString |
getMessageIdBytes()
ID of this message, assigned by the server when the message is published.
|
String |
getOrderingKey()
If non-empty, identifies related messages for which publish order should be
respected.
|
com.google.protobuf.ByteString |
getOrderingKeyBytes()
If non-empty, identifies related messages for which publish order should be
respected.
|
com.google.protobuf.Parser<PubsubMessage> |
getParserForType() |
com.google.protobuf.Timestamp |
getPublishTime()
The time at which the message was published, populated by the server when
it receives the `Publish` call.
|
com.google.protobuf.TimestampOrBuilder |
getPublishTimeOrBuilder()
The time at which the message was published, populated by the server when
it receives the `Publish` call.
|
int |
getSerializedSize() |
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
boolean |
hasPublishTime()
The time at which the message was published, populated by the server when
it receives the `Publish` call.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
protected com.google.protobuf.MapField |
internalGetMapField(int number) |
boolean |
isInitialized() |
static PubsubMessage.Builder |
newBuilder() |
static PubsubMessage.Builder |
newBuilder(PubsubMessage prototype) |
PubsubMessage.Builder |
newBuilderForType() |
protected PubsubMessage.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static PubsubMessage |
parseDelimitedFrom(InputStream input) |
static PubsubMessage |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PubsubMessage |
parseFrom(byte[] data) |
static PubsubMessage |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PubsubMessage |
parseFrom(ByteBuffer data) |
static PubsubMessage |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PubsubMessage |
parseFrom(com.google.protobuf.ByteString data) |
static PubsubMessage |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PubsubMessage |
parseFrom(com.google.protobuf.CodedInputStream input) |
static PubsubMessage |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PubsubMessage |
parseFrom(InputStream input) |
static PubsubMessage |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<PubsubMessage> |
parser() |
PubsubMessage.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int DATA_FIELD_NUMBER
public static final int ATTRIBUTES_FIELD_NUMBER
public static final int MESSAGE_ID_FIELD_NUMBER
public static final int PUBLISH_TIME_FIELD_NUMBER
public static final int ORDERING_KEY_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields in interface com.google.protobuf.MessageOrBuildergetUnknownFields in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.MapField internalGetMapField(int number)
internalGetMapField in class com.google.protobuf.GeneratedMessageV3protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public com.google.protobuf.ByteString getData()
The message data field. If this field is empty, the message must contain at least one attribute.
bytes data = 1;getData in interface PubsubMessageOrBuilderpublic int getAttributesCount()
PubsubMessageOrBuilderAttributes 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.
map<string, string> attributes = 2;getAttributesCount in interface PubsubMessageOrBuilderpublic boolean containsAttributes(String key)
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.
map<string, string> attributes = 2;containsAttributes in interface PubsubMessageOrBuilder@Deprecated public Map<String,String> getAttributes()
getAttributesMap() instead.getAttributes in interface PubsubMessageOrBuilderpublic Map<String,String> getAttributesMap()
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.
map<string, string> attributes = 2;getAttributesMap in interface PubsubMessageOrBuilderpublic String getAttributesOrDefault(String key, String defaultValue)
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.
map<string, string> attributes = 2;getAttributesOrDefault in interface PubsubMessageOrBuilderpublic String getAttributesOrThrow(String key)
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.
map<string, string> attributes = 2;getAttributesOrThrow in interface PubsubMessageOrBuilderpublic 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.
string message_id = 3;getMessageId in interface PubsubMessageOrBuilderpublic com.google.protobuf.ByteString getMessageIdBytes()
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.
string message_id = 3;getMessageIdBytes in interface PubsubMessageOrBuilderpublic boolean hasPublishTime()
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.
.google.protobuf.Timestamp publish_time = 4;hasPublishTime in interface PubsubMessageOrBuilderpublic com.google.protobuf.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.
.google.protobuf.Timestamp publish_time = 4;getPublishTime in interface PubsubMessageOrBuilderpublic com.google.protobuf.TimestampOrBuilder getPublishTimeOrBuilder()
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.
.google.protobuf.Timestamp publish_time = 4;getPublishTimeOrBuilder in interface PubsubMessageOrBuilderpublic String getOrderingKey()
If non-empty, identifies related messages for which publish order should be respected. If a `Subscription` has `enable_message_ordering` set to `true`, messages published with the same non-empty `ordering_key` value will be delivered to subscribers in the order in which they are received by the Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest` must specify the same `ordering_key` value.
string ordering_key = 5;getOrderingKey in interface PubsubMessageOrBuilderpublic com.google.protobuf.ByteString getOrderingKeyBytes()
If non-empty, identifies related messages for which publish order should be respected. If a `Subscription` has `enable_message_ordering` set to `true`, messages published with the same non-empty `ordering_key` value will be delivered to subscribers in the order in which they are received by the Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest` must specify the same `ordering_key` value.
string ordering_key = 5;getOrderingKeyBytes in interface PubsubMessageOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static PubsubMessage parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static PubsubMessage parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static PubsubMessage parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static PubsubMessage parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static PubsubMessage parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static PubsubMessage parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static PubsubMessage parseFrom(InputStream input) throws IOException
IOExceptionpublic static PubsubMessage parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static PubsubMessage parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static PubsubMessage parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static PubsubMessage parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static PubsubMessage parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic PubsubMessage.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static PubsubMessage.Builder newBuilder()
public static PubsubMessage.Builder newBuilder(PubsubMessage prototype)
public PubsubMessage.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected PubsubMessage.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static PubsubMessage getDefaultInstance()
public static com.google.protobuf.Parser<PubsubMessage> parser()
public com.google.protobuf.Parser<PubsubMessage> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public PubsubMessage getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2022 Google LLC. All rights reserved.