Package com.google.pubsub.v1
Class PubsubMessage
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
com.google.pubsub.v1.PubsubMessage
- All Implemented Interfaces:
com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,PubsubMessageOrBuilder,Serializable
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- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA message that is published by publishers and consumed by subscribers.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageV3
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsAttributes(String key) Optional.booleanDeprecated.intOptional.Optional.getAttributesOrDefault(String key, String defaultValue) Optional.Optional.com.google.protobuf.ByteStringgetData()Optional.static PubsubMessagestatic final com.google.protobuf.Descriptors.DescriptorID of this message, assigned by the server when the message is published.com.google.protobuf.ByteStringID of this message, assigned by the server when the message is published.Optional.com.google.protobuf.ByteStringOptional.com.google.protobuf.Parser<PubsubMessage>com.google.protobuf.TimestampThe time at which the message was published, populated by the server when it receives the `Publish` call.com.google.protobuf.TimestampOrBuilderThe time at which the message was published, populated by the server when it receives the `Publish` call.intinthashCode()booleanThe time at which the message was published, populated by the server when it receives the `Publish` call.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableprotected com.google.protobuf.MapFieldReflectionAccessorinternalGetMapFieldReflection(int number) final booleanstatic PubsubMessage.Builderstatic PubsubMessage.BuildernewBuilder(PubsubMessage prototype) protected PubsubMessage.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) static PubsubMessageparseDelimitedFrom(InputStream input) static PubsubMessageparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static PubsubMessageparseFrom(byte[] data) static PubsubMessageparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static PubsubMessageparseFrom(com.google.protobuf.ByteString data) static PubsubMessageparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static PubsubMessageparseFrom(com.google.protobuf.CodedInputStream input) static PubsubMessageparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static PubsubMessageparseFrom(InputStream input) static PubsubMessageparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static PubsubMessageparseFrom(ByteBuffer data) static PubsubMessageparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<PubsubMessage>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, 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, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
DATA_FIELD_NUMBER
public static final int DATA_FIELD_NUMBER- See Also:
-
ATTRIBUTES_FIELD_NUMBER
public static final int ATTRIBUTES_FIELD_NUMBER- See Also:
-
MESSAGE_ID_FIELD_NUMBER
public static final int MESSAGE_ID_FIELD_NUMBER- See Also:
-
PUBLISH_TIME_FIELD_NUMBER
public static final int PUBLISH_TIME_FIELD_NUMBER- See Also:
-
ORDERING_KEY_FIELD_NUMBER
public static final int ORDERING_KEY_FIELD_NUMBER- See Also:
-
-
Method Details
-
newInstance
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetMapFieldReflection
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) - Overrides:
internalGetMapFieldReflectionin classcom.google.protobuf.GeneratedMessageV3
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3
-
getData
public com.google.protobuf.ByteString getData()Optional. The message data field. If this field is empty, the message must contain at least one attribute.
bytes data = 1 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getDatain interfacePubsubMessageOrBuilder- Returns:
- The data.
-
getAttributesCount
public int getAttributesCount()Description copied from interface:PubsubMessageOrBuilderOptional. 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 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getAttributesCountin interfacePubsubMessageOrBuilder
-
containsAttributes
Optional. 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 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
containsAttributesin interfacePubsubMessageOrBuilder
-
getAttributes
Deprecated.UsegetAttributesMap()instead.- Specified by:
getAttributesin interfacePubsubMessageOrBuilder
-
getAttributesMap
Optional. 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 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getAttributesMapin interfacePubsubMessageOrBuilder
-
getAttributesOrDefault
Optional. 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 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getAttributesOrDefaultin interfacePubsubMessageOrBuilder
-
getAttributesOrThrow
Optional. 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 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getAttributesOrThrowin interfacePubsubMessageOrBuilder
-
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;- Specified by:
getMessageIdin interfacePubsubMessageOrBuilder- Returns:
- The messageId.
-
getMessageIdBytes
public 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;- Specified by:
getMessageIdBytesin interfacePubsubMessageOrBuilder- Returns:
- The bytes for messageId.
-
hasPublishTime
public 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;- Specified by:
hasPublishTimein interfacePubsubMessageOrBuilder- Returns:
- Whether the publishTime field is set.
-
getPublishTime
public 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;- Specified by:
getPublishTimein interfacePubsubMessageOrBuilder- Returns:
- The publishTime.
-
getPublishTimeOrBuilder
public 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;- Specified by:
getPublishTimeOrBuilderin interfacePubsubMessageOrBuilder
-
getOrderingKey
Optional. 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. For more information, see [ordering messages](https://cloud.google.com/pubsub/docs/ordering).
string ordering_key = 5 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getOrderingKeyin interfacePubsubMessageOrBuilder- Returns:
- The orderingKey.
-
getOrderingKeyBytes
public com.google.protobuf.ByteString getOrderingKeyBytes()Optional. 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. For more information, see [ordering messages](https://cloud.google.com/pubsub/docs/ordering).
string ordering_key = 5 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getOrderingKeyBytesin interfacePubsubMessageOrBuilder- Returns:
- The bytes for orderingKey.
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static PubsubMessage parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static PubsubMessage parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static PubsubMessage parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static PubsubMessage parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static PubsubMessage parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static PubsubMessage parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static PubsubMessage parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static PubsubMessage parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
public static PubsubMessage parseFrom(com.google.protobuf.CodedInputStream input) throws IOException - Throws:
IOException
-
parseFrom
public static PubsubMessage parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected PubsubMessage.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) - Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-