[jboss-cvs] JBoss Messaging SVN: r7700 - in trunk: examples and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Aug 10 11:43:30 EDT 2009
Author: jmesnil
Date: 2009-08-10 11:43:29 -0400 (Mon, 10 Aug 2009)
New Revision: 7700
Added:
trunk/examples/soak/
trunk/examples/soak/normal/
trunk/examples/soak/normal/src/org/jboss/jms/example/SoakBase.java
trunk/examples/soak/normal/src/org/jboss/jms/example/SoakListener.java
trunk/examples/soak/normal/src/org/jboss/jms/example/SoakParams.java
trunk/examples/soak/normal/src/org/jboss/jms/example/SoakSender.java
Removed:
trunk/examples/soak/normal/src/org/jboss/jms/example/PerfBase.java
trunk/examples/soak/normal/src/org/jboss/jms/example/PerfListener.java
trunk/examples/soak/normal/src/org/jboss/jms/example/PerfParams.java
trunk/examples/soak/normal/src/org/jboss/jms/example/PerfSender.java
Modified:
trunk/.classpath
trunk/examples/soak/normal/build.xml
trunk/examples/soak/normal/jndi.properties
trunk/examples/soak/normal/perf.properties
trunk/examples/soak/normal/server0/jbm-configuration.xml
Log:
Soak example
* code copied from the JMS perf example to boostrap soak examples
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2009-08-10 13:33:44 UTC (rev 7699)
+++ trunk/.classpath 2009-08-10 15:43:29 UTC (rev 7700)
@@ -86,6 +86,7 @@
<classpathentry kind="src" path="examples/javaee/servlet-ssl-example/src"/>
<classpathentry kind="src" path="examples/javaee/servlet-transport/src"/>
<classpathentry kind="src" path="examples/javaee/xarecovery/src"/>
+ <classpathentry kind="src" path="examples/soak/normal/src"/>
<classpathentry kind="lib" path="thirdparty/junit/lib/junit.jar"/>
<classpathentry kind="lib" path="thirdparty/apache-logging/lib/commons-logging.jar"/>
<classpathentry kind="lib" path="thirdparty/apache-xerces/lib/xercesImpl.jar"/>
Copied: trunk/examples/soak/normal (from rev 7696, trunk/examples/jms/perf)
Modified: trunk/examples/soak/normal/build.xml
===================================================================
--- trunk/examples/jms/perf/build.xml 2009-08-10 08:47:31 UTC (rev 7696)
+++ trunk/examples/soak/normal/build.xml 2009-08-10 15:43:29 UTC (rev 7700)
@@ -28,7 +28,7 @@
<!-- =========================================================================================== -->
-<project name="JBoss Messaging JMS Perf Example">
+<project name="JBoss Messaging JMS Soak Example">
<import file="../../common/build.xml"/>
@@ -47,7 +47,7 @@
</path>
<target name="runSender" depends="compile">
- <java classname="org.jboss.jms.example.PerfSender" fork="true" resultproperty="example-result">
+ <java classname="org.jboss.jms.example.SoakSender" fork="true" resultproperty="example-result">
<jvmarg value="-Xms512M"/>
<jvmarg value="-Xmx512M"/>
<jvmarg value="-XX:+UseParallelGC"/>
@@ -60,7 +60,7 @@
</target>
<target name="runListener" depends="compile">
- <java classname="org.jboss.jms.example.PerfListener" fork="true" resultproperty="example-result">
+ <java classname="org.jboss.jms.example.SoakListener" fork="true" resultproperty="example-result">
<jvmarg value="-Xms512M"/>
<jvmarg value="-Xmx512M"/>
<jvmarg value="-XX:+UseParallelGC"/>
@@ -77,11 +77,13 @@
<jvmarg value="-Xms2048M"/>
<jvmarg value="-Xmx2048M"/>
<jvmarg value="-XX:+UseParallelGC"/>
- <sysproperty key="java.library.path" value="${java.library.path}${path.separator}${aio.library.path}"/>
+ <sysproperty key="java.library.path" value="${java.library.path}${path.separator}${aio.library.path}"/>
<jvmarg value="-XX:+AggressiveOpts"/>
- <jvmarg value="-XX:+UseFastAccessorMethods"/>
+ <jvmarg value="-XX:+UseFastAccessorMethods"/>
<jvmarg value="-Djava.util.logging.config.file=${config.dir}/logging.properties"/>
- <arg line="jbm-jboss-beans.xml"/>
+ <jvmarg value="-Dcom.sun.management.jmxremote"/>
+<arg line="jbm-jboss-beans.xml"/>
+ <classpath refid="extra.classpath"/>
<classpath refid="server.classpath"/>
</java>
</target>
Modified: trunk/examples/soak/normal/jndi.properties
===================================================================
--- trunk/examples/jms/perf/jndi.properties 2009-08-10 08:47:31 UTC (rev 7696)
+++ trunk/examples/soak/normal/jndi.properties 2009-08-10 15:43:29 UTC (rev 7700)
@@ -1,3 +1,3 @@
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1199
+java.naming.provider.url=jnp://localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
Modified: trunk/examples/soak/normal/perf.properties
===================================================================
--- trunk/examples/jms/perf/perf.properties 2009-08-10 08:47:31 UTC (rev 7696)
+++ trunk/examples/soak/normal/perf.properties 2009-08-10 15:43:29 UTC (rev 7700)
@@ -1,5 +1,5 @@
-num-messages=1
-num-warmup-messages=0
+num-messages=200
+num-warmup-messages=100
message-size=1024
durable=true
transacted=false
Modified: trunk/examples/soak/normal/server0/jbm-configuration.xml
===================================================================
--- trunk/examples/jms/perf/server0/jbm-configuration.xml 2009-08-10 08:47:31 UTC (rev 7696)
+++ trunk/examples/soak/normal/server0/jbm-configuration.xml 2009-08-10 15:43:29 UTC (rev 7700)
@@ -21,7 +21,7 @@
</acceptor>
</acceptors>
- <backup>true</backup>
+ <backup>false</backup>
<security-enabled>false</security-enabled>
Deleted: trunk/examples/soak/normal/src/org/jboss/jms/example/PerfBase.java
===================================================================
--- trunk/examples/jms/perf/src/org/jboss/jms/example/PerfBase.java 2009-08-10 08:47:31 UTC (rev 7696)
+++ trunk/examples/soak/normal/src/org/jboss/jms/example/PerfBase.java 2009-08-10 15:43:29 UTC (rev 7700)
@@ -1,473 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jms.example;
-
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.Properties;
-import java.util.Random;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.logging.Logger;
-
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.naming.InitialContext;
-
-import org.jboss.messaging.utils.TokenBucketLimiter;
-import org.jboss.messaging.utils.TokenBucketLimiterImpl;
-
-/**
- *
- * A PerfBase
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- *
- */
-public abstract class PerfBase
-{
- private static final Logger log = Logger.getLogger(PerfSender.class.getName());
-
- private static final String DEFAULT_PERF_PROPERTIES_FILE_NAME = "perf.properties";
-
- private static byte[] randomByteArray(final int length)
- {
- byte[] bytes = new byte[length];
-
- Random random = new Random();
-
- for (int i = 0; i < length; i++)
- {
- bytes[i] = Integer.valueOf(random.nextInt()).byteValue();
- }
-
- return bytes;
- }
-
- protected static String getPerfFileName(String[] args)
- {
- String fileName;
-
- if (args.length > 0)
- {
- fileName = args[0];
- }
- else
- {
- fileName = DEFAULT_PERF_PROPERTIES_FILE_NAME;
- }
-
- return fileName;
- }
-
- protected static PerfParams getParams(final String fileName) throws Exception
- {
- Properties props = null;
-
- InputStream is = null;
-
- try
- {
- is = new FileInputStream(fileName);
-
- props = new Properties();
-
- props.load(is);
- }
- finally
- {
- if (is != null)
- {
- is.close();
- }
- }
-
- int noOfMessages = Integer.valueOf(props.getProperty("num-messages"));
- int noOfWarmupMessages = Integer.valueOf(props.getProperty("num-warmup-messages"));
- int messageSize = Integer.valueOf(props.getProperty("message-size"));
- boolean durable = Boolean.valueOf(props.getProperty("durable"));
- boolean transacted = Boolean.valueOf(props.getProperty("transacted"));
- int batchSize = Integer.valueOf(props.getProperty("batch-size"));
- boolean drainQueue = Boolean.valueOf(props.getProperty("drain-queue"));
- String destinationLookup = props.getProperty("destination-lookup");
- String connectionFactoryLookup = props.getProperty("connection-factory-lookup");
- int throttleRate = Integer.valueOf(props.getProperty("throttle-rate"));
- boolean dupsOK = Boolean.valueOf(props.getProperty("dups-ok-acknowlege"));
- boolean disableMessageID = Boolean.valueOf(props.getProperty("disable-message-id"));
- boolean disableTimestamp = Boolean.valueOf(props.getProperty("disable-message-timestamp"));
-
- log.info("num-messages: " + noOfMessages);
- log.info("num-warmup-messages: " + noOfWarmupMessages);
- log.info("message-size: " + messageSize);
- log.info("durable: " + durable);
- log.info("transacted: " + transacted);
- log.info("batch-size: " + batchSize);
- log.info("drain-queue: " + drainQueue);
- log.info("throttle-rate: " + throttleRate);
- log.info("connection-factory-lookup: " + connectionFactoryLookup);
- log.info("destination-lookup: " + destinationLookup);
- log.info("disable-message-id: " + disableMessageID);
- log.info("disable-message-timestamp: " + disableTimestamp);
- log.info("dups-ok-acknowledge: " + dupsOK);
-
- PerfParams perfParams = new PerfParams();
- perfParams.setNoOfMessagesToSend(noOfMessages);
- perfParams.setNoOfWarmupMessages(noOfWarmupMessages);
- perfParams.setMessageSize(messageSize);
- perfParams.setDurable(durable);
- perfParams.setSessionTransacted(transacted);
- perfParams.setBatchSize(batchSize);
- perfParams.setDrainQueue(drainQueue);
- perfParams.setConnectionFactoryLookup(connectionFactoryLookup);
- perfParams.setDestinationLookup(destinationLookup);
- perfParams.setThrottleRate(throttleRate);
- perfParams.setDisableMessageID(disableMessageID);
- perfParams.setDisableTimestamp(disableTimestamp);
- perfParams.setDupsOK(dupsOK);
-
- return perfParams;
- }
-
- private final PerfParams perfParams;
-
- protected PerfBase(final PerfParams perfParams)
- {
- this.perfParams = perfParams;
- }
-
- private ConnectionFactory factory;
-
- private Connection connection;
-
- private Session session;
-
- private Destination destination;
-
- private long start;
-
- private void init() throws Exception
- {
- InitialContext ic = new InitialContext();
-
- factory = (ConnectionFactory)ic.lookup(perfParams.getConnectionFactoryLookup());
-
- destination = (Destination)ic.lookup(perfParams.getDestinationLookup());
-
- connection = factory.createConnection();
-
- session = connection.createSession(perfParams.isSessionTransacted(),
- perfParams.isDupsOK() ? Session.DUPS_OK_ACKNOWLEDGE : Session.AUTO_ACKNOWLEDGE);
-
- ic.close();
- }
-
- private void displayAverage(final long numberOfMessages, final long start, final long end)
- {
- double duration = (1.0 * end - start) / 1000; // in seconds
- double average = (1.0 * numberOfMessages / duration);
- log.info(String.format("average: %.2f msg/s (%d messages in %2.2fs)", average, numberOfMessages, duration));
- }
-
- protected void runSender()
- {
- try
- {
- init();
-
- if (perfParams.isDrainQueue())
- {
- drainQueue();
- }
-
- start = System.currentTimeMillis();
- log.info("warming up by sending " + perfParams.getNoOfWarmupMessages() + " messages");
- sendMessages(perfParams.getNoOfWarmupMessages(),
- perfParams.getBatchSize(),
- perfParams.isDurable(),
- perfParams.isSessionTransacted(),
- false,
- perfParams.getThrottleRate(),
- perfParams.getMessageSize());
- log.info("warmed up");
- start = System.currentTimeMillis();
- sendMessages(perfParams.getNoOfMessagesToSend(),
- perfParams.getBatchSize(),
- perfParams.isDurable(),
- perfParams.isSessionTransacted(),
- true,
- perfParams.getThrottleRate(),
- perfParams.getMessageSize());
- long end = System.currentTimeMillis();
- displayAverage(perfParams.getNoOfMessagesToSend(), start, end);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- if (session != null)
- {
- try
- {
- session.close();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
- }
-
- protected void runListener()
- {
- try
- {
- init();
-
- if (perfParams.isDrainQueue())
- {
- drainQueue();
- }
-
- MessageConsumer consumer = session.createConsumer(destination);
-
- connection.start();
-
- log.info("READY!!!");
-
- CountDownLatch countDownLatch = new CountDownLatch(1);
- consumer.setMessageListener(new PerfListener(countDownLatch, perfParams));
- countDownLatch.await();
- long end = System.currentTimeMillis();
- // start was set on the first received message
- displayAverage(perfParams.getNoOfMessagesToSend(), start, end);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- if (session != null)
- {
- try
- {
- session.close();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
- }
-
- private void drainQueue() throws Exception
- {
- log.info("Draining queue");
-
- Session drainSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- MessageConsumer consumer = drainSession.createConsumer(destination);
-
- connection.start();
-
- Message message = null;
-
- int count = 0;
- do
- {
- message = consumer.receive(3000);
-
- if (message != null)
- {
- message.acknowledge();
-
- count++;
- }
- }
- while (message != null);
-
- drainSession.close();
-
- log.info("Drained " + count + " messages");
- }
-
- private void sendMessages(final int numberOfMessages,
- final int txBatchSize,
- final boolean durable,
- final boolean transacted,
- final boolean display,
- final int throttleRate,
- final int messageSize) throws Exception
- {
- MessageProducer producer = session.createProducer(destination);
-
- producer.setDeliveryMode(perfParams.isDurable() ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
-
- producer.setDisableMessageID(perfParams.isDisableMessageID());
-
- producer.setDisableMessageTimestamp(perfParams.isDisableTimestamp());
-
- BytesMessage message = session.createBytesMessage();
-
- byte[] payload = randomByteArray(messageSize);
-
- message.writeBytes(payload);
-
- final int modulo = 2000;
-
- TokenBucketLimiter tbl = throttleRate != -1 ? new TokenBucketLimiterImpl(throttleRate, false) : null;
-
- boolean committed = false;
- for (int i = 1; i <= numberOfMessages; i++)
- {
- producer.send(message);
-
- if (transacted)
- {
- if (i % txBatchSize == 0)
- {
- session.commit();
- committed = true;
- }
- else
- {
- committed = false;
- }
- }
-
- if (display && (i % modulo == 0))
- {
- double duration = (1.0 * System.currentTimeMillis() - start) / 1000;
- log.info(String.format("sent %6d messages in %2.2fs", i, duration));
- }
-
- if (tbl != null)
- {
- tbl.limit();
- }
- }
- if (transacted && !committed)
- {
- session.commit();
- }
- }
-
- private class PerfListener implements MessageListener
- {
- private final CountDownLatch countDownLatch;
-
- private final PerfParams perfParams;
-
- private boolean warmingUp = true;
-
- private boolean started = false;
-
- private final int modulo;
-
- private final AtomicLong count = new AtomicLong(0);
-
- public PerfListener(final CountDownLatch countDownLatch, final PerfParams perfParams)
- {
- this.countDownLatch = countDownLatch;
- this.perfParams = perfParams;
- warmingUp = perfParams.getNoOfWarmupMessages() > 0;
- this.modulo = 2000;
- }
-
- public void onMessage(final Message message)
- {
- try
- {
- if (warmingUp)
- {
- boolean committed = checkCommit();
- if (count.incrementAndGet() == perfParams.getNoOfWarmupMessages())
- {
- log.info("warmed up after receiving " + count.longValue() + " msgs");
- if (!committed)
- {
- checkCommit();
- }
- warmingUp = false;
- }
- return;
- }
-
- if (!started)
- {
- started = true;
- // reset count to take stats
- count.set(0);
- start = System.currentTimeMillis();
- }
-
- long currentCount = count.incrementAndGet();
- boolean committed = checkCommit();
- if (currentCount == perfParams.getNoOfMessagesToSend())
- {
- if (!committed)
- {
- checkCommit();
- }
- countDownLatch.countDown();
- }
- if (currentCount % modulo == 0)
- {
- double duration = (1.0 * System.currentTimeMillis() - start) / 1000;
- log.info(String.format("received %6d messages in %2.2fs", currentCount, duration));
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- private boolean checkCommit() throws Exception
- {
- if (perfParams.isSessionTransacted())
- {
- if (count.longValue() % perfParams.getBatchSize() == 0)
- {
- session.commit();
-
- return true;
- }
- }
- return false;
- }
- }
-
-}
Deleted: trunk/examples/soak/normal/src/org/jboss/jms/example/PerfListener.java
===================================================================
--- trunk/examples/jms/perf/src/org/jboss/jms/example/PerfListener.java 2009-08-10 08:47:31 UTC (rev 7696)
+++ trunk/examples/soak/normal/src/org/jboss/jms/example/PerfListener.java 2009-08-10 15:43:29 UTC (rev 7700)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jms.example;
-
-import java.util.logging.Logger;
-
-
-/**
- *
- * A PerfListener
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- *
- */
-public class PerfListener extends PerfBase
-{
- private static final Logger log = Logger.getLogger(PerfListener.class.getName());
-
- public static void main(String[] args)
- {
- try
- {
- String fileName = PerfBase.getPerfFileName(args);
-
- PerfParams params = getParams(fileName);
-
- new PerfListener(params).run();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- private PerfListener(final PerfParams perfParams)
- {
- super(perfParams);
- }
-
- public void run() throws Exception
- {
- runListener();
- }
-
-}
Deleted: trunk/examples/soak/normal/src/org/jboss/jms/example/PerfParams.java
===================================================================
--- trunk/examples/jms/perf/src/org/jboss/jms/example/PerfParams.java 2009-08-10 08:47:31 UTC (rev 7696)
+++ trunk/examples/soak/normal/src/org/jboss/jms/example/PerfParams.java 2009-08-10 15:43:29 UTC (rev 7700)
@@ -1,157 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jms.example;
-
-import java.io.Serializable;
-
-/**
- *
- * Class that holds the parameters used in the performance examples
- *
- * @author <a href="ataylor at redhat.com">Andy Taylor</a>
- */
-public class PerfParams implements Serializable
-{
- private static final long serialVersionUID = -4336539641012356002L;
-
- private int noOfMessagesToSend = 1000;
- private int noOfWarmupMessages;
- private int messageSize = 1024; // in bytes
- private boolean durable = false;
- private boolean isSessionTransacted = false;
- private int batchSize = 5000;
- private boolean drainQueue = true;
- private String connectionFactoryLookup;
- private String destinationLookup;
- private int throttleRate;
- private boolean disableMessageID;
- private boolean disableTimestamp;
- private boolean dupsOK;
-
- public synchronized int getNoOfMessagesToSend()
- {
- return noOfMessagesToSend;
- }
- public synchronized void setNoOfMessagesToSend(int noOfMessagesToSend)
- {
- this.noOfMessagesToSend = noOfMessagesToSend;
- }
- public synchronized int getNoOfWarmupMessages()
- {
- return noOfWarmupMessages;
- }
- public synchronized void setNoOfWarmupMessages(int noOfWarmupMessages)
- {
- this.noOfWarmupMessages = noOfWarmupMessages;
- }
- public synchronized int getMessageSize()
- {
- return messageSize;
- }
- public synchronized void setMessageSize(int messageSize)
- {
- this.messageSize = messageSize;
- }
- public synchronized boolean isDurable()
- {
- return durable;
- }
- public synchronized void setDurable(boolean durable)
- {
- this.durable = durable;
- }
- public synchronized boolean isSessionTransacted()
- {
- return isSessionTransacted;
- }
- public synchronized void setSessionTransacted(boolean isSessionTransacted)
- {
- this.isSessionTransacted = isSessionTransacted;
- }
- public synchronized int getBatchSize()
- {
- return batchSize;
- }
- public synchronized void setBatchSize(int batchSize)
- {
- this.batchSize = batchSize;
- }
- public synchronized boolean isDrainQueue()
- {
- return drainQueue;
- }
- public synchronized void setDrainQueue(boolean drainQueue)
- {
- this.drainQueue = drainQueue;
- }
- public synchronized String getConnectionFactoryLookup()
- {
- return connectionFactoryLookup;
- }
- public synchronized void setConnectionFactoryLookup(String connectionFactoryLookup)
- {
- this.connectionFactoryLookup = connectionFactoryLookup;
- }
- public synchronized String getDestinationLookup()
- {
- return destinationLookup;
- }
- public synchronized void setDestinationLookup(String destinationLookup)
- {
- this.destinationLookup = destinationLookup;
- }
- public synchronized int getThrottleRate()
- {
- return throttleRate;
- }
- public synchronized void setThrottleRate(int throttleRate)
- {
- this.throttleRate = throttleRate;
- }
- public synchronized boolean isDisableMessageID()
- {
- return disableMessageID;
- }
- public synchronized void setDisableMessageID(boolean disableMessageID)
- {
- this.disableMessageID = disableMessageID;
- }
- public synchronized boolean isDisableTimestamp()
- {
- return disableTimestamp;
- }
- public synchronized void setDisableTimestamp(boolean disableTimestamp)
- {
- this.disableTimestamp = disableTimestamp;
- }
- public synchronized boolean isDupsOK()
- {
- return dupsOK;
- }
- public synchronized void setDupsOK(boolean dupsOK)
- {
- this.dupsOK = dupsOK;
- }
-
-
-
-}
Deleted: trunk/examples/soak/normal/src/org/jboss/jms/example/PerfSender.java
===================================================================
--- trunk/examples/jms/perf/src/org/jboss/jms/example/PerfSender.java 2009-08-10 08:47:31 UTC (rev 7696)
+++ trunk/examples/soak/normal/src/org/jboss/jms/example/PerfSender.java 2009-08-10 15:43:29 UTC (rev 7700)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jms.example;
-
-import java.util.logging.Logger;
-
-/**
- *
- * A PerfSender
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- *
- */
-public class PerfSender extends PerfBase
-{
- private static final Logger log = Logger.getLogger(PerfSender.class.getName());
-
- public static void main(String[] args)
- {
- try
- {
- String fileName = PerfBase.getPerfFileName(args);
-
- PerfParams params = getParams(fileName);
-
- new PerfSender(params).run();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- private PerfSender(final PerfParams perfParams)
- {
- super(perfParams);
- }
-
- public void run() throws Exception
- {
- runSender();
- }
-
-}
Copied: trunk/examples/soak/normal/src/org/jboss/jms/example/SoakBase.java (from rev 7696, trunk/examples/jms/perf/src/org/jboss/jms/example/PerfBase.java)
===================================================================
--- trunk/examples/soak/normal/src/org/jboss/jms/example/SoakBase.java (rev 0)
+++ trunk/examples/soak/normal/src/org/jboss/jms/example/SoakBase.java 2009-08-10 15:43:29 UTC (rev 7700)
@@ -0,0 +1,473 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jms.example;
+
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.Properties;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.logging.Logger;
+
+import javax.jms.BytesMessage;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
+import javax.jms.Destination;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.naming.InitialContext;
+
+import org.jboss.messaging.utils.TokenBucketLimiter;
+import org.jboss.messaging.utils.TokenBucketLimiterImpl;
+
+/**
+ *
+ * A PerfBase
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ *
+ */
+public abstract class SoakBase
+{
+ private static final Logger log = Logger.getLogger(SoakBase.class.getName());
+
+ private static final String DEFAULT_PERF_PROPERTIES_FILE_NAME = "perf.properties";
+
+ private static byte[] randomByteArray(final int length)
+ {
+ byte[] bytes = new byte[length];
+
+ Random random = new Random();
+
+ for (int i = 0; i < length; i++)
+ {
+ bytes[i] = Integer.valueOf(random.nextInt()).byteValue();
+ }
+
+ return bytes;
+ }
+
+ protected static String getPerfFileName(String[] args)
+ {
+ String fileName;
+
+ if (args.length > 0)
+ {
+ fileName = args[0];
+ }
+ else
+ {
+ fileName = DEFAULT_PERF_PROPERTIES_FILE_NAME;
+ }
+
+ return fileName;
+ }
+
+ protected static SoakParams getParams(final String fileName) throws Exception
+ {
+ Properties props = null;
+
+ InputStream is = null;
+
+ try
+ {
+ is = new FileInputStream(fileName);
+
+ props = new Properties();
+
+ props.load(is);
+ }
+ finally
+ {
+ if (is != null)
+ {
+ is.close();
+ }
+ }
+
+ int noOfMessages = Integer.valueOf(props.getProperty("num-messages"));
+ int noOfWarmupMessages = Integer.valueOf(props.getProperty("num-warmup-messages"));
+ int messageSize = Integer.valueOf(props.getProperty("message-size"));
+ boolean durable = Boolean.valueOf(props.getProperty("durable"));
+ boolean transacted = Boolean.valueOf(props.getProperty("transacted"));
+ int batchSize = Integer.valueOf(props.getProperty("batch-size"));
+ boolean drainQueue = Boolean.valueOf(props.getProperty("drain-queue"));
+ String destinationLookup = props.getProperty("destination-lookup");
+ String connectionFactoryLookup = props.getProperty("connection-factory-lookup");
+ int throttleRate = Integer.valueOf(props.getProperty("throttle-rate"));
+ boolean dupsOK = Boolean.valueOf(props.getProperty("dups-ok-acknowlege"));
+ boolean disableMessageID = Boolean.valueOf(props.getProperty("disable-message-id"));
+ boolean disableTimestamp = Boolean.valueOf(props.getProperty("disable-message-timestamp"));
+
+ log.info("num-messages: " + noOfMessages);
+ log.info("num-warmup-messages: " + noOfWarmupMessages);
+ log.info("message-size: " + messageSize);
+ log.info("durable: " + durable);
+ log.info("transacted: " + transacted);
+ log.info("batch-size: " + batchSize);
+ log.info("drain-queue: " + drainQueue);
+ log.info("throttle-rate: " + throttleRate);
+ log.info("connection-factory-lookup: " + connectionFactoryLookup);
+ log.info("destination-lookup: " + destinationLookup);
+ log.info("disable-message-id: " + disableMessageID);
+ log.info("disable-message-timestamp: " + disableTimestamp);
+ log.info("dups-ok-acknowledge: " + dupsOK);
+
+ SoakParams perfParams = new SoakParams();
+ perfParams.setNoOfMessagesToSend(noOfMessages);
+ perfParams.setNoOfWarmupMessages(noOfWarmupMessages);
+ perfParams.setMessageSize(messageSize);
+ perfParams.setDurable(durable);
+ perfParams.setSessionTransacted(transacted);
+ perfParams.setBatchSize(batchSize);
+ perfParams.setDrainQueue(drainQueue);
+ perfParams.setConnectionFactoryLookup(connectionFactoryLookup);
+ perfParams.setDestinationLookup(destinationLookup);
+ perfParams.setThrottleRate(throttleRate);
+ perfParams.setDisableMessageID(disableMessageID);
+ perfParams.setDisableTimestamp(disableTimestamp);
+ perfParams.setDupsOK(dupsOK);
+
+ return perfParams;
+ }
+
+ private final SoakParams perfParams;
+
+ protected SoakBase(final SoakParams perfParams)
+ {
+ this.perfParams = perfParams;
+ }
+
+ private ConnectionFactory factory;
+
+ private Connection connection;
+
+ private Session session;
+
+ private Destination destination;
+
+ private long start;
+
+ private void init() throws Exception
+ {
+ InitialContext ic = new InitialContext();
+
+ factory = (ConnectionFactory)ic.lookup(perfParams.getConnectionFactoryLookup());
+
+ destination = (Destination)ic.lookup(perfParams.getDestinationLookup());
+
+ connection = factory.createConnection();
+
+ session = connection.createSession(perfParams.isSessionTransacted(),
+ perfParams.isDupsOK() ? Session.DUPS_OK_ACKNOWLEDGE : Session.AUTO_ACKNOWLEDGE);
+
+ ic.close();
+ }
+
+ private void displayAverage(final long numberOfMessages, final long start, final long end)
+ {
+ double duration = (1.0 * end - start) / 1000; // in seconds
+ double average = (1.0 * numberOfMessages / duration);
+ log.info(String.format("average: %.2f msg/s (%d messages in %2.2fs)", average, numberOfMessages, duration));
+ }
+
+ protected void runSender()
+ {
+ try
+ {
+ init();
+
+ if (perfParams.isDrainQueue())
+ {
+ drainQueue();
+ }
+
+ start = System.currentTimeMillis();
+ log.info("warming up by sending " + perfParams.getNoOfWarmupMessages() + " messages");
+ sendMessages(perfParams.getNoOfWarmupMessages(),
+ perfParams.getBatchSize(),
+ perfParams.isDurable(),
+ perfParams.isSessionTransacted(),
+ false,
+ perfParams.getThrottleRate(),
+ perfParams.getMessageSize());
+ log.info("warmed up");
+ start = System.currentTimeMillis();
+ sendMessages(perfParams.getNoOfMessagesToSend(),
+ perfParams.getBatchSize(),
+ perfParams.isDurable(),
+ perfParams.isSessionTransacted(),
+ true,
+ perfParams.getThrottleRate(),
+ perfParams.getMessageSize());
+ long end = System.currentTimeMillis();
+ displayAverage(perfParams.getNoOfMessagesToSend(), start, end);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ if (session != null)
+ {
+ try
+ {
+ session.close();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ protected void runListener()
+ {
+ try
+ {
+ init();
+
+ if (perfParams.isDrainQueue())
+ {
+ drainQueue();
+ }
+
+ MessageConsumer consumer = session.createConsumer(destination);
+
+ connection.start();
+
+ log.info("READY!!!");
+
+ CountDownLatch countDownLatch = new CountDownLatch(1);
+ consumer.setMessageListener(new PerfListener(countDownLatch, perfParams));
+ countDownLatch.await();
+ long end = System.currentTimeMillis();
+ // start was set on the first received message
+ displayAverage(perfParams.getNoOfMessagesToSend(), start, end);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ if (session != null)
+ {
+ try
+ {
+ session.close();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ private void drainQueue() throws Exception
+ {
+ log.info("Draining queue");
+
+ Session drainSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ MessageConsumer consumer = drainSession.createConsumer(destination);
+
+ connection.start();
+
+ Message message = null;
+
+ int count = 0;
+ do
+ {
+ message = consumer.receive(3000);
+
+ if (message != null)
+ {
+ message.acknowledge();
+
+ count++;
+ }
+ }
+ while (message != null);
+
+ drainSession.close();
+
+ log.info("Drained " + count + " messages");
+ }
+
+ private void sendMessages(final int numberOfMessages,
+ final int txBatchSize,
+ final boolean durable,
+ final boolean transacted,
+ final boolean display,
+ final int throttleRate,
+ final int messageSize) throws Exception
+ {
+ MessageProducer producer = session.createProducer(destination);
+
+ producer.setDeliveryMode(perfParams.isDurable() ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
+
+ producer.setDisableMessageID(perfParams.isDisableMessageID());
+
+ producer.setDisableMessageTimestamp(perfParams.isDisableTimestamp());
+
+ BytesMessage message = session.createBytesMessage();
+
+ byte[] payload = randomByteArray(messageSize);
+
+ message.writeBytes(payload);
+
+ final int modulo = 2000;
+
+ TokenBucketLimiter tbl = throttleRate != -1 ? new TokenBucketLimiterImpl(throttleRate, false) : null;
+
+ boolean committed = false;
+ for (int i = 1; i <= numberOfMessages; i++)
+ {
+ producer.send(message);
+
+ if (transacted)
+ {
+ if (i % txBatchSize == 0)
+ {
+ session.commit();
+ committed = true;
+ }
+ else
+ {
+ committed = false;
+ }
+ }
+
+ if (display && (i % modulo == 0))
+ {
+ double duration = (1.0 * System.currentTimeMillis() - start) / 1000;
+ log.info(String.format("sent %6d messages in %2.2fs", i, duration));
+ }
+
+ if (tbl != null)
+ {
+ tbl.limit();
+ }
+ }
+ if (transacted && !committed)
+ {
+ session.commit();
+ }
+ }
+
+ private class PerfListener implements MessageListener
+ {
+ private final CountDownLatch countDownLatch;
+
+ private final SoakParams perfParams;
+
+ private boolean warmingUp = true;
+
+ private boolean started = false;
+
+ private final int modulo;
+
+ private final AtomicLong count = new AtomicLong(0);
+
+ public PerfListener(final CountDownLatch countDownLatch, final SoakParams perfParams)
+ {
+ this.countDownLatch = countDownLatch;
+ this.perfParams = perfParams;
+ warmingUp = perfParams.getNoOfWarmupMessages() > 0;
+ this.modulo = 2000;
+ }
+
+ public void onMessage(final Message message)
+ {
+ try
+ {
+ if (warmingUp)
+ {
+ boolean committed = checkCommit();
+ if (count.incrementAndGet() == perfParams.getNoOfWarmupMessages())
+ {
+ log.info("warmed up after receiving " + count.longValue() + " msgs");
+ if (!committed)
+ {
+ checkCommit();
+ }
+ warmingUp = false;
+ }
+ return;
+ }
+
+ if (!started)
+ {
+ started = true;
+ // reset count to take stats
+ count.set(0);
+ start = System.currentTimeMillis();
+ }
+
+ long currentCount = count.incrementAndGet();
+ boolean committed = checkCommit();
+ if (currentCount == perfParams.getNoOfMessagesToSend())
+ {
+ if (!committed)
+ {
+ checkCommit();
+ }
+ countDownLatch.countDown();
+ }
+ if (currentCount % modulo == 0)
+ {
+ double duration = (1.0 * System.currentTimeMillis() - start) / 1000;
+ log.info(String.format("received %6d messages in %2.2fs", currentCount, duration));
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ private boolean checkCommit() throws Exception
+ {
+ if (perfParams.isSessionTransacted())
+ {
+ if (count.longValue() % perfParams.getBatchSize() == 0)
+ {
+ session.commit();
+
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+}
Copied: trunk/examples/soak/normal/src/org/jboss/jms/example/SoakListener.java (from rev 7696, trunk/examples/jms/perf/src/org/jboss/jms/example/PerfListener.java)
===================================================================
--- trunk/examples/soak/normal/src/org/jboss/jms/example/SoakListener.java (rev 0)
+++ trunk/examples/soak/normal/src/org/jboss/jms/example/SoakListener.java 2009-08-10 15:43:29 UTC (rev 7700)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jms.example;
+
+import java.util.logging.Logger;
+
+
+/**
+ *
+ * A PerfListener
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ *
+ */
+public class SoakListener extends SoakBase
+{
+ private static final Logger log = Logger.getLogger(SoakListener.class.getName());
+
+ public static void main(String[] args)
+ {
+ try
+ {
+ String fileName = SoakBase.getPerfFileName(args);
+
+ SoakParams params = getParams(fileName);
+
+ new SoakListener(params).run();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ private SoakListener(final SoakParams perfParams)
+ {
+ super(perfParams);
+ }
+
+ public void run() throws Exception
+ {
+ runListener();
+ }
+
+}
Copied: trunk/examples/soak/normal/src/org/jboss/jms/example/SoakParams.java (from rev 7696, trunk/examples/jms/perf/src/org/jboss/jms/example/PerfParams.java)
===================================================================
--- trunk/examples/soak/normal/src/org/jboss/jms/example/SoakParams.java (rev 0)
+++ trunk/examples/soak/normal/src/org/jboss/jms/example/SoakParams.java 2009-08-10 15:43:29 UTC (rev 7700)
@@ -0,0 +1,157 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jms.example;
+
+import java.io.Serializable;
+
+/**
+ *
+ * Class that holds the parameters used in the performance examples
+ *
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ */
+public class SoakParams implements Serializable
+{
+ private static final long serialVersionUID = -4336539641012356002L;
+
+ private int noOfMessagesToSend = 1000;
+ private int noOfWarmupMessages;
+ private int messageSize = 1024; // in bytes
+ private boolean durable = false;
+ private boolean isSessionTransacted = false;
+ private int batchSize = 5000;
+ private boolean drainQueue = true;
+ private String connectionFactoryLookup;
+ private String destinationLookup;
+ private int throttleRate;
+ private boolean disableMessageID;
+ private boolean disableTimestamp;
+ private boolean dupsOK;
+
+ public synchronized int getNoOfMessagesToSend()
+ {
+ return noOfMessagesToSend;
+ }
+ public synchronized void setNoOfMessagesToSend(int noOfMessagesToSend)
+ {
+ this.noOfMessagesToSend = noOfMessagesToSend;
+ }
+ public synchronized int getNoOfWarmupMessages()
+ {
+ return noOfWarmupMessages;
+ }
+ public synchronized void setNoOfWarmupMessages(int noOfWarmupMessages)
+ {
+ this.noOfWarmupMessages = noOfWarmupMessages;
+ }
+ public synchronized int getMessageSize()
+ {
+ return messageSize;
+ }
+ public synchronized void setMessageSize(int messageSize)
+ {
+ this.messageSize = messageSize;
+ }
+ public synchronized boolean isDurable()
+ {
+ return durable;
+ }
+ public synchronized void setDurable(boolean durable)
+ {
+ this.durable = durable;
+ }
+ public synchronized boolean isSessionTransacted()
+ {
+ return isSessionTransacted;
+ }
+ public synchronized void setSessionTransacted(boolean isSessionTransacted)
+ {
+ this.isSessionTransacted = isSessionTransacted;
+ }
+ public synchronized int getBatchSize()
+ {
+ return batchSize;
+ }
+ public synchronized void setBatchSize(int batchSize)
+ {
+ this.batchSize = batchSize;
+ }
+ public synchronized boolean isDrainQueue()
+ {
+ return drainQueue;
+ }
+ public synchronized void setDrainQueue(boolean drainQueue)
+ {
+ this.drainQueue = drainQueue;
+ }
+ public synchronized String getConnectionFactoryLookup()
+ {
+ return connectionFactoryLookup;
+ }
+ public synchronized void setConnectionFactoryLookup(String connectionFactoryLookup)
+ {
+ this.connectionFactoryLookup = connectionFactoryLookup;
+ }
+ public synchronized String getDestinationLookup()
+ {
+ return destinationLookup;
+ }
+ public synchronized void setDestinationLookup(String destinationLookup)
+ {
+ this.destinationLookup = destinationLookup;
+ }
+ public synchronized int getThrottleRate()
+ {
+ return throttleRate;
+ }
+ public synchronized void setThrottleRate(int throttleRate)
+ {
+ this.throttleRate = throttleRate;
+ }
+ public synchronized boolean isDisableMessageID()
+ {
+ return disableMessageID;
+ }
+ public synchronized void setDisableMessageID(boolean disableMessageID)
+ {
+ this.disableMessageID = disableMessageID;
+ }
+ public synchronized boolean isDisableTimestamp()
+ {
+ return disableTimestamp;
+ }
+ public synchronized void setDisableTimestamp(boolean disableTimestamp)
+ {
+ this.disableTimestamp = disableTimestamp;
+ }
+ public synchronized boolean isDupsOK()
+ {
+ return dupsOK;
+ }
+ public synchronized void setDupsOK(boolean dupsOK)
+ {
+ this.dupsOK = dupsOK;
+ }
+
+
+
+}
Copied: trunk/examples/soak/normal/src/org/jboss/jms/example/SoakSender.java (from rev 7696, trunk/examples/jms/perf/src/org/jboss/jms/example/PerfSender.java)
===================================================================
--- trunk/examples/soak/normal/src/org/jboss/jms/example/SoakSender.java (rev 0)
+++ trunk/examples/soak/normal/src/org/jboss/jms/example/SoakSender.java 2009-08-10 15:43:29 UTC (rev 7700)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jms.example;
+
+import java.util.logging.Logger;
+
+/**
+ *
+ * A PerfSender
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ *
+ */
+public class SoakSender extends SoakBase
+{
+ private static final Logger log = Logger.getLogger(SoakSender.class.getName());
+
+ public static void main(String[] args)
+ {
+ try
+ {
+ String fileName = SoakBase.getPerfFileName(args);
+
+ SoakParams params = getParams(fileName);
+
+ new SoakSender(params).run();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ private SoakSender(final SoakParams perfParams)
+ {
+ super(perfParams);
+ }
+
+ public void run() throws Exception
+ {
+ runSender();
+ }
+
+}
More information about the jboss-cvs-commits
mailing list