Foren

ApacheDS Adding Multiple Records With Muliple Signup

Varun Arya, geändert vor 6 Jahren.

ApacheDS Adding Multiple Records With Muliple Signup

New Member Beiträge: 24 Beitrittsdatum: 02.03.17 Neueste Beiträge
I am using ApacheDS LDAP with Liferay. In my application while sign up i am creating user in my LDAP. It is taking approx 1.5 second to insert one record. While load testing i am getting

LDAP response read timed out, timeout used:15000ms.

ApacheDS is taking time to response and i got connection timeout exception. Is there is any way to fast insert. Please suggest me how to handle this thing and how liferay handle this if ldap export and required enabled.


                private static Hashtable<string, object> env = new Hashtable<string, object>(15);
                env.put(Context.SECURITY_AUTHENTICATION, "simple");
		if (getUsername() != null) {
			env.put(Context.SECURITY_PRINCIPAL, getUsername());
		}
		if (getPassword() != null) {
			env.put(Context.SECURITY_CREDENTIALS, getPassword());
		}
		env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
		env.put(Context.PROVIDER_URL, getLdapAdServer());
               env.put("java.naming.ldap.attributes.binary", "objectSID");

        	env.put("com.sun.jndi.ldap.connect.pool", "true");
		env.put("com.sun.jndi.ldap.connect.pool.authentication", "simple");
		env.put("com.sun.jndi.ldap.connect.pool.maxsize","50");
                env.put("com.sun.jndi.ldap.connect.pool.prefsize","25"); 
 		env.put("com.sun.jndi.ldap.connect.pool.timeout", "300000");
                LdapContext ctx = new InitialLdapContext(env, null);

                Attributes attributes = new BasicAttributes();
		attributes.put("objectClass","inetOrgPerson");
		attributes.put("sn",user.getLastName());
		attributes.put("cn",user.getEmail().split("@")[0] + "" + user.getEmail().split("@")[1]);
		attributes.put("givenName",user.getFirstName());
		attributes.put("mail",user.getEmail());
		attributes.put("uid",user.getEmail());
		attributes.put("employeeNumber",user.getEmail());
		attributes.put("description","NA");
		attributes.put("userPassword",user.getPassword());
		attributes.put("title","comparison");
		attributes.put("employeeType",user.getEmployeeType());
		attributes.put("teletexTerminalIdentifier", user.getUserBtype());

               ctx.createSubcontext("uid=" + user.getEmail() + "," + LdapConnection.getPartition(), attributes);
               ctx.close();

</string,></string,>


This is called each time while signup.