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

Unable to specify the "reconnectTries" and "reconnectInterval" settings

    • Type: Icon: Question Question
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 4.5.0
    • Component/s: Configuration

      Summary

      I could not find, in any of the provided Settings builders, __ how to modify the "reconnect" options. I would really like to reduce the total timeout to less than 5 seconds. I've tried using "connectTimeout", "maxWaitTime", "readTimeout", "maxConnectionIdleTime".

      Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).

      Local mongodb instance with java driver (sync) 4.5.0.

      How to Reproduce

      MongoClient client = MongoClients.create(MongoClientSettings.builder().<what_here?>.build();
      MongoDatabase database = client.getDatabase("test");
      database.listCollectionNames().first(); // takes 30s before timeout...

       

      Additional Background

      Please provide any additional background information that may be helpful in diagnosing the bug.

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            lolgab1@hotmail.com Gab St-Pierre
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: