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 2022/08/01 13:52:22 UTC

[GitHub] [beam] johnjcasey commented on a diff in pull request #22375: fix pulsar reader calls

johnjcasey commented on code in PR #22375:
URL: https://github.com/apache/beam/pull/22375#discussion_r934558030


##########
sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/ReadFromPulsarDoFn.java:
##########
@@ -155,11 +155,11 @@ public ProcessContinuation processElement(
         reader.seek(startTimestamp);
       }
       while (true) {
-        if (reader.hasReachedEndOfTopic()) {
+        if (!reader.hasMessageAvailable()) {
           reader.close();
           return ProcessContinuation.stop();
         }
-        Message<byte[]> message = reader.readNext();
+        Message<byte[]> message = reader.readNext(5, TimeUnit.SECONDS);

Review Comment:
   why did you choose 5 seconds here?



-- 
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: github-unsubscribe@beam.apache.org

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