You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/06/02 16:17:14 UTC

[GitHub] [beam] kennknowles commented on a change in pull request #14917: Extract PubsubMessage transforms in PubsubMessages and use them to add a compatability transform for Pub/Sub Lite.

kennknowles commented on a change in pull request #14917:
URL: https://github.com/apache/beam/pull/14917#discussion_r644119288



##########
File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/CloudPubsubTransforms.java
##########
@@ -48,4 +49,21 @@ private CloudPubsubChecks() {}
               return message;
             });
   }
+
+  /**
+   * Transform messages read from Pub/Sub Lite to their equivalent Cloud Pub/Sub Message that would
+   * have been read from PubsubIO.
+   *
+   * <p>Will fail the pipeline if a message has multiple attributes per map key.
+   */
+  public static PTransform<PCollection<? extends SequencedMessage>, PCollection<PubsubMessage>>

Review comment:
       Can you write this as a composite transform? Same logic, but in the `expand` method. A bit of boilerplate that helps out UIs and metrics, etc.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org