Class 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 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
      • toCpsPublishTransformer

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