activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r651619 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNetworkTest.java
Date Fri, 25 Apr 2008 14:50:00 GMT
Author: rajdavies
Date: Fri Apr 25 07:49:58 2008
New Revision: 651619

URL: http://svn.apache.org/viewvc?rev=651619&view=rev
Log:
start consumers/producers

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNetworkTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNetworkTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNetworkTest.java?rev=651619&r1=651618&r2=651619&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNetworkTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNetworkTest.java
Fri Apr 25 07:49:58 2008
@@ -31,7 +31,6 @@
 public class SimpleNetworkTest extends SimpleTopicTest {
 
     private static final Log LOG = LogFactory.getLog(SimpleNetworkTest.class);
-    //protected String consumerBindAddress = "tcp://rexmac.home:61616?wireFormat.maxInactivityDuration=1000,tcp://localhost:61617?wireFormat.maxInactivityDuration=1000";
     protected String consumerBindAddress = "tcp://localhost:61616";
     protected String producerBindAddress = "tcp://localhost:61617";
     protected static final String CONSUMER_BROKER_NAME = "Consumer";
@@ -49,10 +48,7 @@
         if (producerBroker == null) {
             producerBroker = createProducerBroker(producerBindAddress);
         }
-        //consumerFactory = createConnectionFactory("vm://"+CONSUMER_BROKER_NAME);
-        //producerFactory = createConnectionFactory("vm://"+ PRODUCER_BROKER_NAME);
-        consumerFactory = createConnectionFactory("failover://("+consumerBindAddress + ","
+ producerBindAddress +")?randomize=false&backup=false");
-        //consumerFactory = createConnectionFactory("failover://("+consumerBindAddress+")?backup=true");
+        consumerFactory = createConnectionFactory(consumerBindAddress);
         consumerFactory.setDispatchAsync(true);
         ActiveMQPrefetchPolicy policy = new ActiveMQPrefetchPolicy();
         policy.setQueuePrefetch(100);
@@ -63,23 +59,23 @@
         
         producers = new PerfProducer[numberofProducers*numberOfDestinations];
         consumers = new PerfConsumer[numberOfConsumers*numberOfDestinations];
-        int consumerCount = 0;
-        int producerCount = 0;
+        
         for (int k =0; k < numberOfDestinations;k++) {
             Destination destination = createDestination(session, destinationName+":"+k);
             LOG.info("Testing against destination: " + destination);
             for (int i = 0; i < numberOfConsumers; i++) {
-                consumers[consumerCount] = createConsumer(consumerFactory, destination, consumerCount);
-                consumers[consumerCount].setSleepDuration(consumerSleepDuration);
-                consumerCount++;
+                consumers[i] = createConsumer(consumerFactory, destination, i);
+                consumers[i].setSleepDuration(consumerSleepDuration);
+                consumers[i].start();
             }
             for (int i = 0; i < numberofProducers; i++) {
                 array = new byte[playloadSize];
                 for (int j = i; j < array.length; j++) {
                     array[j] = (byte)j;
                 }
-                producers[producerCount] = createProducer(producerFactory, destination, i,
array);
-                producerCount++;
+                producers[i] = createProducer(producerFactory, destination, i, array);
+                producers[i].start();
+               
             }
         }
         con.close();



Mime
View raw message