Class MessageTransforms (1.14.4)

public class 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.

Inheritance

java.lang.Object > MessageTransforms

Static Fields

PUBSUB_LITE_EVENT_TIME_TIMESTAMP_PROTO

public static final String PUBSUB_LITE_EVENT_TIME_TIMESTAMP_PROTO
Field Value
Type Description
String

Static Methods

decodeAttributeEventTime(String encoded)

public static Timestamp decodeAttributeEventTime(String encoded)

Decode a timestamp encoded with encodeAttributeEventTime.

Parameter
Name Description
encoded String
Returns
Type Description
Timestamp
Exceptions
Type Description
ApiException

encodeAttributeEventTime(Timestamp timestamp)

public static String encodeAttributeEventTime(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.

Parameter
Name Description
timestamp Timestamp
Returns
Type Description
String

fromCpsPublishTransformer(KeyExtractor keyExtractor)

public static MessageTransformer<PubsubMessage,Message> fromCpsPublishTransformer(KeyExtractor keyExtractor)
Parameter
Name Description
keyExtractor KeyExtractor
Returns
Type Description
MessageTransformer<com.google.pubsub.v1.PubsubMessage,Message>

toCpsPublishTransformer()

public static MessageTransformer<Message,PubsubMessage> toCpsPublishTransformer()
Returns
Type Description
MessageTransformer<Message,com.google.pubsub.v1.PubsubMessage>

toCpsSubscribeTransformer()

public static MessageTransformer<SequencedMessage,PubsubMessage> toCpsSubscribeTransformer()
Returns
Type Description
MessageTransformer<SequencedMessage,com.google.pubsub.v1.PubsubMessage>