alwaysUseMBeans is not honoured

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.11.2
    • Component/s: Monitoring
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      As advised in JAVA-641, in order to use MBeans on Java 6 or greater alwaysUseMBeans has to be set to "true". Even if set, it may not work.

      Test case:

              MongoClientOptions.Builder builder = new MongoClientOptions.Builder();
              builder.alwaysUseMBeans(true);
              MongoClient mongoConn = new MongoClient(new MongoClientURI("mongodb://localhost:27017", builder));
              System.out.println(mongoConn.getMongoOptions().isAlwaysUseMBeans()); // Output: false
      

      Patch with a code fix is attached.

              Assignee:
              Unassigned
              Reporter:
              Aliaksandr Voitau
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: