Effective October 27, 2012, online and email support for FuseSource products will move to Red Hat support channels. For more information, please see the JIRA Migration to Red Hat FAQ.
As of October 27th, please open all new issues in the Red Hat Customer Portal .
Issue Details (XML | Word | Printable)

Key: MB-841
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dejan Bosanac
Reporter: Susan Javurek
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
FUSE Message Broker

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

Created: 18/Mar/11 02:45 PM   Updated: 30/Mar/11 10:16 AM
Component/s: broker
Affects Version/s: 5.4.2-fuse-02-00
Fix Version/s: 5.5.0-fuse-00-00

External Issue URL: https://issues.apache.org/jira/browse/AMQ-3244


 Description  « Hide
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



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Dejan Bosanac added a comment - 29/Mar/11 01:51 PM
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


Susan Javurek added a comment - 30/Mar/11 10:07 AM
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


Dejan Bosanac added a comment - 30/Mar/11 10:16 AM
Hi Susan,

yes

reload=false

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