Class CloudPubsubTransforms

java.lang.Object
org.apache.beam.sdk.io.gcp.pubsublite.CloudPubsubTransforms

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

    • ensureUsableAsCloudPubsub

      public static PTransform<PCollection<com.google.cloud.pubsublite.proto.PubSubMessage>,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 PTransform<PCollection<com.google.cloud.pubsublite.proto.SequencedMessage>,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 PTransform<PCollection<PubsubMessage>,PCollection<com.google.cloud.pubsublite.proto.PubSubMessage>> fromCloudPubsubMessages()
      Transform messages publishable using PubsubIO to their equivalent Pub/Sub Lite publishable message.