fernando-wizeline commented on a change in pull request #17015:
URL: https://github.com/apache/beam/pull/17015#discussion_r826117880
##########
File path:
examples/java/src/main/java/org/apache/beam/examples/complete/game/GameStats.java
##########
@@ -242,13 +242,20 @@ public static void main(String[] args) throws Exception {
ExampleUtils exampleUtils = new ExampleUtils(options);
Pipeline pipeline = Pipeline.create(options);
+ // Run the pipeline and wait for the pipeline to finish; capture
cancellation requests from the
+ // command line.
+ PipelineResult result = runGameStats(options, pipeline);
+ exampleUtils.waitToFinish(result);
+ }
+
+ static PipelineResult runGameStats(Options options, Pipeline pipeline) {
// Read Events from Pub/Sub using custom timestamps
PCollection<GameActionInfo> rawEvents =
pipeline
.apply(
PubsubIO.readStrings()
- .withTimestampAttribute(GameConstants.TIMESTAMP_ATTRIBUTE)
- .fromTopic(options.getTopic()))
+ .fromSubscription(options.getSubscription())
Review comment:
Oh, If I'm not mistaken, If no subscription is provided when reading,
the API will crate its own one. I'm feeding the subscription I created during
the IT setup so I can delete it later.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]