fernando-wizeline commented on a change in pull request #17015:
URL: https://github.com/apache/beam/pull/17015#discussion_r835962861
##########
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:
If it is ok, I would like to keep using the subscription created within
the IT instead of the one created automatically when trying to read from the
topic. Not sure why, but it looks like reading from the topic is a blocking
operation and the pipeline never reaches the following step.
--
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]