Class MessageTransforms
- java.lang.Object
-
- com.google.cloud.pubsublite.cloudpubsub.MessageTransforms
-
public class MessageTransforms extends Object
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 Modifier and Type Field Description static String
PUBSUB_LITE_EVENT_TIME_TIMESTAMP_PROTO
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.protobuf.Timestamp
decodeAttributeEventTime(String encoded)
Decode a timestamp encoded with encodeAttributeEventTime.static String
encodeAttributeEventTime(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>
toCpsPublishTransformer()
static MessageTransformer<SequencedMessage,com.google.pubsub.v1.PubsubMessage>
toCpsSubscribeTransformer()
-
-
-
Field Detail
-
PUBSUB_LITE_EVENT_TIME_TIMESTAMP_PROTO
public static final String PUBSUB_LITE_EVENT_TIME_TIMESTAMP_PROTO
- See Also:
- Constant Field Values
-
-
Method Detail
-
encodeAttributeEventTime
public static String encodeAttributeEventTime(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.
-
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)
-
-