Class MessageTransforms (1.10.0)

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
TypeDescription
String

Static Methods

decodeAttributeEventTime(String encoded)

public static Timestamp decodeAttributeEventTime(String encoded)

Decode a timestamp encoded with encodeAttributeEventTime.

Parameter
NameDescription
encodedString
Returns
TypeDescription
Timestamp
Exceptions
TypeDescription
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
NameDescription
timestampTimestamp
Returns
TypeDescription
String

fromCpsPublishTransformer(KeyExtractor keyExtractor)

public static MessageTransformer<PubsubMessage,Message> fromCpsPublishTransformer(KeyExtractor keyExtractor)
Parameter
NameDescription
keyExtractorKeyExtractor
Returns
TypeDescription
MessageTransformer<com.google.pubsub.v1.PubsubMessage,Message>

toCpsPublishTransformer()

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

toCpsSubscribeTransformer()

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