Uploaded image for project: 'FUSE Message Broker'
  1. FUSE Message Broker
  2. MB-841

Login.config, user and group properties are re-open with each connection.

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 5.4.2-fuse-02-00
    • Fix Version/s: 5.5.0-fuse-00-00
    • Component/s: broker
    • Labels:
      None

      Description

      Hi,

      We've noticed that with each connection, the files noted above seem to be re-open each time. In a scenario where many client send one message , this can cause an adverse impact on performance. Is there any way to open this file once or if need be implement a periodic check for changes?

      We can see this behavior simply with the debug logging on;

      2011-03-18 14:29:37,828 | DEBUG | Initialized debug=true usersFile=users2.properties groupsFile=groups2.properties basedir=/Users/sjavurek/Fuse/activemq/apache-activemq-5.4.2-fuse-02-00/dev2943/conf | org.apache.activemq.jaas.PropertiesLoginModule | ActiveMQ Transport: tcp:///127.0.0.1:61331

      If I've read the code correctly this comes from PropertiesLoginModule:

              if (System.getProperty("java.security.auth.login.config") != null) {
              	System.out.println("****** GET login file");
                  baseDir = new File(System.getProperty("java.security.auth.login.config")).getParentFile();
              } else {
                  baseDir = new File(".");
              }
       
              debug = "true".equalsIgnoreCase((String)options.get("debug"));
              usersFile = (String)options.get(USER_FILE) + "";
              groupsFile = (String)options.get(GROUP_FILE) + "";
       
              if (debug) {
                  LOG.debug("Initialized debug=" + debug + " usersFile=" + usersFile + " groupsFile=" + groupsFile + " basedir=" + baseDir);
              }

      I also added a few additional debug statements where these files are read. When I run our PropertiesLoginModuleTest junt test, I can see the code executed 3 times (once for each test):

       Here in static
      ****** GET login file
      *******  OPEN USERS
      *******  OPEN GROUPS
      ****** GET login file
      *******  OPEN USERS
      *******  OPEN GROUPS
      ****** GET login file
      *******  OPEN USERS
      *******  OPEN GROUPS

      Kindest regards,
      Susan

        Gliffy Diagrams

          Activity

          Hide
          dbosanac Dejan Bosanac added a comment -

          I added an extra property that enables this module to cache values in memory (for more info see original issue).

          It will be available in the next release, and it can be tested using the latest snapshot (20110329.132334-7) from here

          http://repo.fusesource.com/nexus/content/repositories/snapshots/org/apache/activemq/apache-activemq/5.5-fuse-SNAPSHOT/

          BTW. I didn't notice any significant improvements in performances, but maybe customer's use case will be different

          Show
          dbosanac Dejan Bosanac added a comment - I added an extra property that enables this module to cache values in memory (for more info see original issue). It will be available in the next release, and it can be tested using the latest snapshot (20110329.132334-7) from here http://repo.fusesource.com/nexus/content/repositories/snapshots/org/apache/activemq/apache-activemq/5.5-fuse-SNAPSHOT/ BTW. I didn't notice any significant improvements in performances, but maybe customer's use case will be different
          Hide
          sjavurek Susan Javurek added a comment -

          Hi Dejan,

          To clarify, if we set the reload=files, the data is cached and never read again, even if they are changed?

          Thanks for turning this around so quickly,
          Susan

          Show
          sjavurek Susan Javurek added a comment - Hi Dejan, To clarify, if we set the reload=files, the data is cached and never read again, even if they are changed? Thanks for turning this around so quickly, Susan
          Hide
          dbosanac Dejan Bosanac added a comment -

          Hi Susan,

          yes

          reload=false

          will make the file just being read on the startup. Periodic file checking will need another improvement.

          Show
          dbosanac Dejan Bosanac added a comment - Hi Susan, yes reload=false will make the file just being read on the startup. Periodic file checking will need another improvement.

            People

            • Assignee:
              dbosanac Dejan Bosanac
              Reporter:
              sjavurek Susan Javurek
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: