Commit b0c8efd5 authored by Andre Freyssinet's avatar Andre Freyssinet
Browse files

Tests Queue loading at startup with a big number of waiting messages (Joram-358).

parent 9680a018
......@@ -38,9 +38,10 @@ logger.com.scalagent.level WARN
logger.org.objectweb.joram.level WARN
# logger.fr.dyade.aaa.util.ReliableTcpConnection.level DEBUG
# logger.org.objectweb.joram.mom.level DEBUG
logger.org.objectweb.joram.mom.messages.level INFO
# logger.org.objectweb.joram.mom.dest.level DEBUG
# logger.org.objectweb.joram.mom.dest.Queue.level INFO
# logger.org.objectweb.joram.mom.dest.Queue.Message.level INFO
logger.org.objectweb.joram.mom.dest.Queue.level INFO
#logger.org.objectweb.joram.mom.dest.Queue.Message.level INFO
# logger.org.objectweb.joram.mom.dest.QueueDeliveryTable.level DEBUG
# logger.org.objectweb.joram.client.level DEBUG
# logger.org.objectweb.joram.mom.proxies.level DEBUG
......
......@@ -4741,7 +4741,7 @@
</antcall>
</target>
<target name="noreg.test57" depends="noreg.test57-1,noreg.test57-2,noreg.test57-3,noreg.test57-4"/>
<target name="noreg.test57" depends="noreg.test57-1,noreg.test57-2,noreg.test57-3,noreg.test57-4,noreg.test57-3-jdbc,noreg.test57-4-jdbc"/>
<target name="noreg.test57-1" depends="init.a3props,compile"
description=" --> Test server restart with a lot of big messages">
......@@ -4750,7 +4750,7 @@
<param name="jndiconf" value="noreg/jndi.properties"/>
<param name="a3conf" value="noreg/a3servers1.xml"/>
<param name="testid" value="noreg.test57-1"/>
<param name="jvmargs" value="-DDestination=org.objectweb.joram.client.jms.Queue -DMsgSize=256 -DNbMsg=238"/>
<param name="jvmargs" value="-DswapAllowed=false -DDestination=org.objectweb.joram.client.jms.Queue -DMsgSize=256 -DNbMsg=238"/>
</antcall>
</target>
......@@ -4761,7 +4761,7 @@
<param name="jndiconf" value="noreg/jndi.properties"/>
<param name="a3conf" value="noreg/a3servers1.xml"/>
<param name="testid" value="noreg.test57-2"/>
<param name="jvmargs" value="-Dorg.objectweb.joram.mom.messages.SWAPALLOWED=true -DDestination=org.objectweb.joram.client.jms.Queue -DMsgSize=256 -DNbMsg=5000"/>
<param name="jvmargs" value="-DswapAllowed=true -DDestination=org.objectweb.joram.client.jms.Queue -DMsgSize=256 -DNbMsg=5000"/>
</antcall>
</target>
......@@ -4772,8 +4772,8 @@
<param name="className" value="joram.noreg.Test57"/>
<param name="jndiconf" value="noreg/jndi.properties"/>
<param name="a3conf" value="noreg/a3servers2.xml"/>
<param name="testid" value="noreg.test57-4"/>
<param name="jvmargs" value="-Dorg.objectweb.joram.mom.messages.SWAPALLOWED=true -DDestination=org.objectweb.joram.client.jms.Queue -DMsgSize=1 -DNbMsg=160000"/>
<param name="testid" value="noreg.test57-3"/>
<param name="jvmargs" value="-DswapAllowed=true -DDestination=org.objectweb.joram.client.jms.Queue -DMsgSize=1 -DNbMsg=150000"/>
</antcall>
</target>
......@@ -4784,8 +4784,40 @@
<param name="className" value="joram.noreg.Test57"/>
<param name="jndiconf" value="noreg/jndi.properties"/>
<param name="a3conf" value="noreg/a3servers2.xml"/>
<param name="testid" value="noreg.test57-5"/>
<param name="jvmargs" value="-DMomMessageClass=org.objectweb.joram.shared.messages.MessageSoftRef -DDestination=org.objectweb.joram.client.jms.Queue -DMsgSize=1 -DfixedInMemory=true -DNbMsg=160000"/>
<param name="testid" value="noreg.test57-4"/>
<param name="jvmargs" value="-DswapAllowed=true -DDestination=org.objectweb.joram.client.jms.Queue -DMsgSize=1 -DfixedInMemory=true -DNbMsg=150000"/>
</antcall>
</target>
<target name="noreg.test57-3-jdbc" depends="init.a3props,compile"
description=" --> Test server restart with a very big number of normal (1Kb) messages">
<!-- Use JDBC Transaction configuration -->
<antcall target="test.run" inheritAll="true">
<param name="className" value="joram.noreg.Test57"/>
<param name="jndiconf" value="noreg/jndi.properties"/>
<param name="a3conf" value="noreg/a3servers2_jdbc.xml"/>
<param name="transaction" value="fr.dyade.aaa.ext.JDBCTransaction"/>
<param name="a3props" value="a3jdbc.props"/>
<param name="testid" value="noreg.test57-3-jdbc"/>
<param name="jvmargs" value="-DswapAllowed=true -DDestination=org.objectweb.joram.client.jms.Queue -DMsgSize=1 -DNbMsg=150000"/>
</antcall>
</target>
<target name="noreg.test57-4-jdbc" depends="init.a3props,compile"
description=" --> Test server restart with a very big number of normal (1Kb) messages">
<!-- Use JDBC Transaction configuration, and fixedInMemory to force queue load at starting -->
<antcall target="test.run" inheritAll="true">
<param name="className" value="joram.noreg.Test57"/>
<param name="jndiconf" value="noreg/jndi.properties"/>
<param name="a3conf" value="noreg/a3servers2_jdbc.xml"/>
<param name="transaction" value="fr.dyade.aaa.ext.JDBCTransaction"/>
<param name="a3props" value="a3jdbc.props"/>
<param name="testid" value="noreg.test57-4-jdbc"/>
<param name="jvmargs" value="-DswapAllowed=true -DDestination=org.objectweb.joram.client.jms.Queue -DMsgSize=1 -DfixedInMemory=true -DNbMsg=150000"/>
</antcall>
</target>
......
......@@ -59,21 +59,23 @@ public class Test57 extends BaseTest {
}
public void run(String[] args) {
boolean fixedInMemory = false;
String[] jmwargs = null;
try {
try {
boolean swapAllowed = Boolean.getBoolean("swapAllowed");
MsgSize = Integer.getInteger("MsgSize", MsgSize/1024).intValue() *1024;
NbMsg = Integer.getInteger("NbMsg", NbMsg).intValue();
String destc = System.getProperty("Destination","org.objectweb.joram.client.jms.Queue");
boolean fixedInMemory = Boolean.getBoolean("fixedInMemory");
if (swapAllowed)
jmwargs = new String[]{"-Dorg.objectweb.joram.mom.messages.SWAPALLOWED=true"};
System.out.println("server start");
TestCase.startAgentServer((short) 0);
TestCase.startAgentServer((short) 0, jmwargs);
Thread.sleep(2000);
writeIntoFile("===================== start test 57 =====================");
MsgSize = Integer.getInteger("MsgSize", MsgSize/1024).intValue() *1024;
NbMsg = Integer.getInteger("NbMsg", NbMsg).intValue();
String destc = System.getProperty("Destination",
"org.objectweb.joram.client.jms.Queue");
fixedInMemory = Boolean.getBoolean("fixedInMemory");
writeIntoFile("----------------------------------------------------");
writeIntoFile("Destination: " + destc + " fixedInMemory: " + fixedInMemory);
writeIntoFile("MsgSize: " + MsgSize);
......@@ -112,12 +114,17 @@ public class Test57 extends BaseTest {
content[i] = (byte) (i & 0xFF);
long start = System.currentTimeMillis();
long start2 = start;
for (int nb=0; nb<NbMsg; nb++) {
BytesMessage msg = sess.createBytesMessage();
msg.writeBytes(content);
prod.send(msg);
sentMsgId[nb] = msg.getJMSMessageID();
System.out.println("message sent #" +nb);
if ((nb %10000) == 9999) {
long end2 = System.currentTimeMillis();
System.out.println("message sent #" +nb + " -> " + (end2 - start2));
start2 = end2;
}
}
long end = System.currentTimeMillis();
System.out.println("All messages sent: " + ((end -start)/1000L));
......@@ -135,7 +142,6 @@ public class Test57 extends BaseTest {
// kill and restart server
System.out.println("Server stop ");
TestCase.stopAgentServer((short) 0);
// Thread.sleep(30000L);
Thread.sleep(1000L);
System.out.println("server start");
TestCase.startAgentServer((short) 0);
......@@ -147,19 +153,32 @@ public class Test57 extends BaseTest {
}
try {
long start = System.currentTimeMillis();
Connection cnx = cf.createConnection();
Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer cons = sess.createConsumer(dest);
cnx.start();
long end = System.currentTimeMillis();
System.out.println("Connection started: " + ((end -start)/1000L));
long start = System.currentTimeMillis();
start = System.currentTimeMillis();
long start2 = start;
for (int nb=0; nb<NbMsg; nb++) {
BytesMessage msg = (BytesMessage) cons.receive();
if (nb == 0) {
end = System.currentTimeMillis();
System.out.println("1st message received: " + ((end -start)/1000L));
}
boolean good = msg.getJMSMessageID().equals(sentMsgId[nb]);
BaseTest.assertTrue("Receive bad msg #" + nb, good);
System.out.println("message received#" + nb + (good?" ok":" nok"));
if ((nb %10000) == 9999) {
long end2 = System.currentTimeMillis();
System.out.println("message received#" + nb + (good?" ok":" nok") + " -> " + (end2 - start2));
start2 = end2;
}
}
long end = System.currentTimeMillis();
end = System.currentTimeMillis();
System.out.println("All messages received: " + ((end -start)/1000L));
cons.close();
......
......@@ -3,7 +3,7 @@
<property name="Engine" value="@engine@"/>
<property name="Transaction" value="@transaction@"/>
<property name="Transaction.NbLogFile" value="16" />
<property name="Transaction.NbLogFile" value="32" />
<property name="Transaction.MaxLogFileSize" value="32" />
<server id="0" name="S0" hostname="localhost">
......
<?xml version="1.0"?>
<config>
<property name="Engine" value="@engine@"/>
<property name="Transaction" value="fr.dyade.aaa.ext.JDBCTransaction"/>
<property name="Transaction.UseLockFile" value="false"/>
<property name="org.ow2.joram.jdbc.transaction.driver" value="org.apache.derby.jdbc.EmbeddedDriver"/>
<property name="org.ow2.joram.jdbc.transaction.url" value="jdbc:derby:MyJoramDB@@sid@@;create=true"/>
<property name="org.ow2.joram.dbtransaction.dbtable" value="MyTable"/>
<property name="org.ow2.joram.jdbc.transaction.dbname" value="MyJoramDB@@sid@@"/>
<property name="org.ow2.joram.jdbc.transaction.user" value="user1"/>
<property name="org.ow2.joram.jdbc.transaction.password" value="pass1"/>
<property name="org.ow2.joram.jdbc.transaction.dbinit" value="CREATE TABLE MyTable (name VARCHAR(256), content BLOB(16M), PRIMARY KEY(name))"/>
<server id="0" name="S0" hostname="localhost">
<property name="fr.dyade.aaa.util.ReliableTcpConnection.windowSize"
value="100"/>
<service class="org.objectweb.joram.mom.proxies.ConnectionManager"
args="root root"/>
<service class="fr.dyade.aaa.agent.AdminProxy" args="7890"/>
<service class="org.objectweb.joram.mom.proxies.tcp.TcpProxyService"
args="16010"/>
<service class="fr.dyade.aaa.jndi2.server.JndiServer" args="16400"/>
</server>
</config>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment