Package com.google.cloud.pubsublite
Class MessageMetadata
java.lang.Object
com.google.cloud.pubsublite.MessageMetadata
Information about a message in Pub/Sub Lite. Can be encoded in the string returned by the Cloud
Pub/Sub
Publisher.publish(com.google.pubsub.v1.PubsubMessage) api or the PubsubMessage.getMessageId() field on received messages.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageMetadataDecode a MessageMetadata from the Cloud Pub/Sub ack id.encode()Encode a publish metadata as a Cloud Pub/Sub ack id.static MessageMetadataConstruct a MessageMetadata from a Partition and Offset.abstract Offsetoffset()The offset a message was assigned.abstract PartitionThe partition a message was published to.
-
Constructor Details
-
MessageMetadata
public MessageMetadata()
-
-
Method Details
-
partition
The partition a message was published to. -
offset
The offset a message was assigned.If this MessageMetadata was returned for a publish result and publish idempotence was enabled, the offset may be -1 when the message was identified as a duplicate of an already successfully published message, but the server did not have sufficient information to return the message's offset at publish time. Messages received by subscribers will always have the correct offset.
-
of
Construct a MessageMetadata from a Partition and Offset. -
decode
Decode a MessageMetadata from the Cloud Pub/Sub ack id.- Throws:
com.google.api.gax.rpc.ApiException
-
encode
Encode a publish metadata as a Cloud Pub/Sub ack id.
-