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

alwaysUseMBeans is not honoured

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.11.2
    • Component/s: Monitoring
    • Labels:
      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.

        1. alwaysUseMBeans.patch
          0.5 kB
          Aliaksandr Voitau

            Assignee:
            Unassigned Unassigned
            Reporter:
            aliaksandr.voitau@mtvncontractor.com Aliaksandr Voitau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: