Package com.google.cloud.pubsublite
Class Message
- java.lang.Object
-
- com.google.cloud.pubsublite.Message
-
public abstract class Message extends Object
A user message.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Message.Builder
-
Constructor Summary
Constructors Constructor Description Message()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract com.google.common.collect.ImmutableListMultimap<String,com.google.protobuf.ByteString>
attributes()
A multimap of attributes for this message.static Message.Builder
builder()
Get a new builder for a message.abstract com.google.protobuf.ByteString
data()
The data payload for this message.abstract Optional<com.google.protobuf.Timestamp>
eventTime()
The user-provided event time for this message.static Message
fromProto(PubSubMessage proto)
Construct a message from a proto.abstract com.google.protobuf.ByteString
key()
The key for this message.abstract Message.Builder
toBuilder()
Convert an existing message to a builder.PubSubMessage
toProto()
Convert this to a message proto.
-
-
-
Method Detail
-
key
public abstract com.google.protobuf.ByteString key()
The key for this message. All messages with the same key are routed to the same partition.
-
data
public abstract com.google.protobuf.ByteString data()
The data payload for this message.
-
attributes
public abstract com.google.common.collect.ImmutableListMultimap<String,com.google.protobuf.ByteString> attributes()
A multimap of attributes for this message.
-
eventTime
public abstract Optional<com.google.protobuf.Timestamp> eventTime()
The user-provided event time for this message.
-
builder
public static Message.Builder builder()
Get a new builder for a message.
-
toBuilder
public abstract Message.Builder toBuilder()
Convert an existing message to a builder.
-
toProto
public PubSubMessage toProto()
Convert this to a message proto.
-
fromProto
public static Message fromProto(PubSubMessage proto)
Construct a message from a proto.
-
-