Class MessageTransforms
java.lang.Object
com.google.cloud.pubsublite.cloudpubsub.MessageTransforms
MessageTransforms details how to transform message representations from Cloud Pub/Sub to Pub/Sub
Lite.
Transformers are made public to allow user code that currently uses PubsubMessages to use interfaces interacting with Pub/Sub Lite.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.protobuf.TimestampdecodeAttributeEventTime(String encoded) Decode a timestamp encoded with encodeAttributeEventTime.static StringencodeAttributeEventTime(com.google.protobuf.Timestamp timestamp) Encode a timestamp in a way that it will be interpreted as an event time if published on a message with an attribute named PUBSUB_LITE_EVENT_TIME_TIMESTAMP_PROTO.static MessageTransformer<com.google.pubsub.v1.PubsubMessage,Message> fromCpsPublishTransformer(KeyExtractor keyExtractor) static MessageTransformer<Message,com.google.pubsub.v1.PubsubMessage> static MessageTransformer<SequencedMessage,com.google.pubsub.v1.PubsubMessage>
-
Field Details
-
PUBSUB_LITE_EVENT_TIME_TIMESTAMP_PROTO
- See Also:
-
-
Method Details
-
encodeAttributeEventTime
Encode a timestamp in a way that it will be interpreted as an event time if published on a message with an attribute named PUBSUB_LITE_EVENT_TIME_TIMESTAMP_PROTO. -
decodeAttributeEventTime
public static com.google.protobuf.Timestamp decodeAttributeEventTime(String encoded) throws com.google.api.gax.rpc.ApiException Decode a timestamp encoded with encodeAttributeEventTime.- Throws:
com.google.api.gax.rpc.ApiException
-
toCpsSubscribeTransformer
public static MessageTransformer<SequencedMessage,com.google.pubsub.v1.PubsubMessage> toCpsSubscribeTransformer() -
toCpsPublishTransformer
public static MessageTransformer<Message,com.google.pubsub.v1.PubsubMessage> toCpsPublishTransformer() -
fromCpsPublishTransformer
public static MessageTransformer<com.google.pubsub.v1.PubsubMessage,Message> fromCpsPublishTransformer(KeyExtractor keyExtractor)
-