[JBoss Messaging] - Sending a message to a queue is slow sometimes.
by croy
Hi,
I am experiencing periodic performance issues when sending an object to a message queue on jboss 5 jmessaging.
Normally this operation takes 10 ms but sometimes(1%) I see 5+ seconds below is the code.
I have ruled out Garbage collection as the cause. Any advice on the code below specifically on the message send line and why it would be a resource problem - any queue sizing I need to be aware of?
I use mysql as the persistence layer to a localhost database - any connection pool sizing I should be aware of ( I use a connection pool of min 5 / max 20 ).
Any advice on performance please ?
Thanks,
Colm
public final static void sendObjectToQueue(String queueName,
| EPOSBatchMessage messageObject) {
| long startTime = System.currentTimeMillis();
| QueueConnection conn = null;
| QueueSession session = null;
| Queue que = null;
| InitialContext iniCtx = null;
| QueueConnectionFactory qcf = null;
| Object tmp = null;
| QueueSender send = null;
| try {
| log.debug("PERFORMANCE: (sendObjectToQueue): size of message: " + messageObject.toString().length() + " - " + (System.currentTimeMillis() - startTime ) + "(ms)");
|
| iniCtx = new InitialContext();
| tmp = iniCtx.lookup("ConnectionFactory");
| qcf = (QueueConnectionFactory) tmp;
| log.debug("PERFORMANCE: (sendObjectToQueue): About to create connection: " + (System.currentTimeMillis() - startTime ) + "(ms)");
| conn = qcf.createQueueConnection();
| log.debug("PERFORMANCE: (sendObjectToQueue): Connection Created: " + (System.currentTimeMillis() - startTime ) + "(ms)");
| que = (Queue) iniCtx.lookup(queueName);
| log.debug("PERFORMANCE: (sendObjectToQueue): Queue lookup succeeded: " + (System.currentTimeMillis() - startTime ) + "(ms)");
| session = conn.createQueueSession(false,
| QueueSession.AUTO_ACKNOWLEDGE);
| log.debug("PERFORMANCE: (sendObjectToQueue): Session Created: " + (System.currentTimeMillis() - startTime ) + "(ms)");
| send = session.createSender(que);
| log.debug("PERFORMANCE: (sendObjectToQueue): Sender Created: " + (System.currentTimeMillis() - startTime ) + "(ms)");
| ObjectMessage om = session.createObjectMessage();
| om.setObject(messageObject);
| log.debug("PERFORMANCE: (sendObjectToQueue): Message Created: " + (System.currentTimeMillis() - startTime ) + "(ms)");
| send.send(om); // <----- this is where the slow down is occuring
| log.debug("PERFORMANCE: (sendObjectToQueue): Message Sent: " + (System.currentTimeMillis() - startTime ) + "(ms)");
| log.info("sendMessage, sent object = " + om
| + " sent queue = " + queueName);
| if(send!=null){ send.close(); }
| if(conn!=null){conn.close();}
| if(session!=null){session.close();}
| }catch (Exception e){
| log.error("In sendObjectToQueue: caught exception: " + e);
| e.printStackTrace();
| }
| long endTime = System.currentTimeMillis();
| long time = endTime - startTime;
| log.debug("PERFORMANCE: (sendObjectToQueue" + queueName + " , " + messageObject + "): Time Taken: " + time + "(ms)");
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4226728#4226728
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226728
17 years, 4 months
[JBoss Portal] - Re: How to set drag and drop functionalities to user
by vivek_saini07
see, do not confuse with dashboard context with portal context.
There are two things. When you access url /portal/auth/dashboard/... you are at dashboard context, and when you are accessing url like /portal/auth/portal/... you are at portal context.
Till now you have set DnD for dashboard context only. To set DnD for portal context, go to default-object.xml and set the theme.dyna.dnd_enabled for individual portals.
If you set this property for root context, it will make everything DnD enabled.
In following is the snippet of default-object.xml where I am setting this property with root context.
|
| <!DOCTYPE deployments PUBLIC
| "-//JBoss Portal//DTD Portal Object 2.6//EN"
| "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
|
| <deployments>
| <deployment>
| <context>
| <context-name/>
| <properties>
|
| <property>
| <name>theme.dyna.dnd_enabled</name>
| <value>true</value>
| </property>
|
|
| <!--
| | Set the layout for the default portal, see also portal-layouts.xml.
| -->
| <property>
| <name>layout.id</name>
| <value>generic</value>
| </property>
| <!--
| | Set the theme for the default portal, see also portal-themes.xml.
| -->
| <property>
| <name>theme.id</name>
| <value>renewal</value>
| </property>
| <!--
| | Set the default render set name (used by the render tag in layouts), see also portal-renderSet.xml
| -->
| <property>
| <name>theme.renderSetId</name>
| <value>divRenderer</value>
| </property>
| .....
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4226727#4226727
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226727
17 years, 4 months
[Security & JAAS/JBoss] - DatabaseLoginServerModule implementing problems
by NSchweig
Hi,
I am very confused about implementing a simple example with the DatabaseLoginServerModule.
Is there anywhere an example-project I can use?
I only found http://docs.jboss.org/jbossas/jboss4guide/r5/html/ch8.chapter.html
and that is not really an example.
Here is my problem:
I have got a web project with form based authentication.
login.html
<html>
| <body>
| <h1>Please Authenticate</h1>
| <form method="POST" action="j_security_check">
| User Name: <input type="text" name="j_username" /><br />
| Password: <input type="password" name="j_password" /><br />
| <input type="submit" value="Login" />
| </form>
| </body>
| </html>
These are my security settings in the web.xml
<security-constraint>
| <web-resource-collection>
| <web-resource-name>restricted</web-resource-name>
| <url-pattern>/secured_pages/*</url-pattern>
| <http-method>GET</http-method>
| <http-method>POST</http-method>
| </web-resource-collection>
| <auth-constraint>
| <role-name>java</role-name>
| </auth-constraint>
| </security-constraint>
| <login-config>
| <auth-method>FORM</auth-method>
| <form-login-config>
| <form-login-page>/login.html</form-login-page>
| <form-error-page>/error.html</form-error-page>
| </form-login-config>
| </login-config>
| <security-role>
| <role-name>java</role-name>
| </security-role>
In the jboss directory C:\jboss-5.0.1.GA\server\default\conf I made the following entry in the login-config.xml
| <application-policy name="databaselogin">
| <authentication>
| <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
| <module-option name="dsJndiName">java:/databaselogin</module-option>
| <module-option name="debug">true</module-option>
|
| <module-option name="principalsQuery">
| select passwd from users username where username=?</module-option>
| <module-option name="rolesQuery">
| select userroles, 'roles' from userroles where username=?</module-option>
| </login-module>
| </authentication>
| </application-policy>
In the web-inf-directory of my web-application I got the file jboss-web.xml:
<?xml version='1.0' encoding='UTF-8' ?>
|
| <!DOCTYPE jboss-web
| PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN"
| "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
|
| <jboss-web>
| <security-domain>java:/jaas/databaselogin</security-domain>
| </jboss-web>
|
Then I created a testdatabase in my databasetool:
table roles: username, rolename, rolegroupname
table users: username, passwd
table userroles: username,userroles
Every table has one record. Every field is filled with the String "java".
If I try to get access to the application with the authenticationform with username 'java' and password 'java' I always get the error page that says my username or password is wrong.
What am I doing wrong?
I would be very pleased about any help!
Thanks NSchweig
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4226707#4226707
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226707
17 years, 4 months