suztomo commented on a change in pull request #14578:
URL: https://github.com/apache/beam/pull/14578#discussion_r616743471
##########
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:
What's the last argument for addDefaultMetadata?
<img width="1028" alt="Screen Shot 2021-04-20 at 10 33 21"
src="https://user-images.githubusercontent.com/28604/115414229-db9b1300-a1c3-11eb-9737-ae548c203c2b.png">
--
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]