Class CloudPubsubTransforms


  • public final class CloudPubsubTransforms
    extends java.lang.Object
    A class providing transforms between Cloud Pub/Sub and Pub/Sub Lite message types.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.cloud.pubsublite.proto.PubSubMessage>,​org.apache.beam.sdk.values.PCollection<com.google.cloud.pubsublite.proto.PubSubMessage>> ensureUsableAsCloudPubsub()
      Ensure that all messages that pass through can be converted to Cloud Pub/Sub messages using the standard transformation methods in the client library.
      static org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<PubsubMessage>,​org.apache.beam.sdk.values.PCollection<com.google.cloud.pubsublite.proto.PubSubMessage>> fromCloudPubsubMessages()
      Transform messages publishable using PubsubIO to their equivalent Pub/Sub Lite publishable message.
      static org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.cloud.pubsublite.proto.SequencedMessage>,​org.apache.beam.sdk.values.PCollection<PubsubMessage>> toCloudPubsubMessages()
      Transform messages read from Pub/Sub Lite to their equivalent Cloud Pub/Sub Message that would have been read from PubsubIO.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • ensureUsableAsCloudPubsub

        public static org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.cloud.pubsublite.proto.PubSubMessage>,​org.apache.beam.sdk.values.PCollection<com.google.cloud.pubsublite.proto.PubSubMessage>> ensureUsableAsCloudPubsub()
        Ensure that all messages that pass through can be converted to Cloud Pub/Sub messages using the standard transformation methods in the client library.

        Will fail the pipeline if a message has multiple attributes per key.

      • toCloudPubsubMessages

        public static org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.cloud.pubsublite.proto.SequencedMessage>,​org.apache.beam.sdk.values.PCollection<PubsubMessage>> toCloudPubsubMessages()
        Transform messages read from Pub/Sub Lite to their equivalent Cloud Pub/Sub Message that would have been read from PubsubIO.

        Will fail the pipeline if a message has multiple attributes per map key.

      • fromCloudPubsubMessages

        public static org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<PubsubMessage>,​org.apache.beam.sdk.values.PCollection<com.google.cloud.pubsublite.proto.PubSubMessage>> fromCloudPubsubMessages()
        Transform messages publishable using PubsubIO to their equivalent Pub/Sub Lite publishable message.