Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2965

maxAwaitTime not working on a change stream

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.8.0
    • Component/s: Query Operations
    • Labels:
      None

      I'm using the java driver version 3.8.0 and mongodb 3.6.

      The documentation here states about maxAwaitTime:

      The maximum amount of time for the server to wait on new documents to satisfy a change stream query.

      However, what I'm seeing is that cursor.hasNext() returns only if there is a change on the collection, never when the time passed to maxAwaitTime has elapsed.

      When I turn on mongodb's verbose logging I see maxWaitTime set as expected in the getMore command.

      Is maxAwaitTime supposed to cause my watch to timeout when there are no changes?

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            crummel Chris
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: