suztomo commented on a change in pull request #14578:
URL: https://github.com/apache/beam/pull/14578#discussion_r616740904



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/Publishers.java
##########
@@ -35,24 +36,28 @@
   private Publishers() {}
 
   @SuppressWarnings("unchecked")
-  static Publisher<PublishMetadata> newPublisher(PublisherOptions options) 
throws ApiException {
+  static Publisher<MessageMetadata> newPublisher(PublisherOptions options) 
throws ApiException {
     SerializableSupplier<Object> supplier = options.publisherSupplier();
     if (supplier != null) {
       Object supplied = supplier.get();
-      TypeToken<Publisher<PublishMetadata>> token = new 
TypeToken<Publisher<PublishMetadata>>() {};
+      TypeToken<Publisher<MessageMetadata>> token = new 
TypeToken<Publisher<MessageMetadata>>() {};
       checkArgument(token.isSupertypeOf(supplied.getClass()));
-      return (Publisher<PublishMetadata>) supplied;
+      return (Publisher<MessageMetadata>) supplied;
     }
-    return new PartitionCountWatchingPublisher(
+
+    TopicPath topic = options.topicPath();
+    PartitionCountWatchingPublisherSettings.Builder publisherSettings =
         PartitionCountWatchingPublisherSettings.newBuilder()
-            .setTopic(options.topicPath())
+            .setTopic(topic)
             .setPublisherFactory(
                 partition ->
                     SinglePartitionPublisherBuilder.newBuilder()
-                        .setTopic(options.topicPath())
+                        .setTopic(topic)
                         .setPartition(partition)
-                        .setContext(PubsubContext.of(FRAMEWORK))

Review comment:
       This needs to be replaced with
   
   ```
                     addDefaultMetadata(
                         PubsubContext.of(FRAMEWORK),
                         RoutingMetadata.of(topic, partition),
                         settingsBuilder);
   ```




-- 
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:
[email protected]


Reply via email to