diff --git a/activemq-console/src/main/java/org/apache/activemq/console/command/ConsumerCommand.java b/activemq-console/src/main/java/org/apache/activemq/console/command/ConsumerCommand.java index 9439f953ec..8c677cc716 100644 --- a/activemq-console/src/main/java/org/apache/activemq/console/command/ConsumerCommand.java +++ b/activemq-console/src/main/java/org/apache/activemq/console/command/ConsumerCommand.java @@ -60,17 +60,16 @@ public class ConsumerCommand extends AbstractCommand { } conn.start(); - Session sess; - if (transacted) { - sess = conn.createSession(true, Session.SESSION_TRANSACTED); - } else { - sess = conn.createSession(false, ackMode); - } - CountDownLatch active = new CountDownLatch(parallelThreads); for (int i = 1; i <= parallelThreads; i++) { + Session sess; + if (transacted) { + sess = conn.createSession(true, Session.SESSION_TRANSACTED); + } else { + sess = conn.createSession(false, ackMode); + } ConsumerThread consumer = new ConsumerThread(sess, ActiveMQDestination.createDestination(destination, ActiveMQDestination.QUEUE_TYPE)); consumer.setName("consumer-" + i); consumer.setDurable(durable); diff --git a/activemq-console/src/main/java/org/apache/activemq/console/command/ProducerCommand.java b/activemq-console/src/main/java/org/apache/activemq/console/command/ProducerCommand.java index 8138a2c7c3..ab1ad2b638 100644 --- a/activemq-console/src/main/java/org/apache/activemq/console/command/ProducerCommand.java +++ b/activemq-console/src/main/java/org/apache/activemq/console/command/ProducerCommand.java @@ -60,16 +60,15 @@ public class ProducerCommand extends AbstractCommand { conn = factory.createConnection(user, password); conn.start(); - Session sess; - if (transactionBatchSize != 0) { - sess = conn.createSession(true, Session.SESSION_TRANSACTED); - } else { - sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); - } - CountDownLatch active = new CountDownLatch(parallelThreads); for (int i = 1; i <= parallelThreads; i++) { + Session sess; + if (transactionBatchSize != 0) { + sess = conn.createSession(true, Session.SESSION_TRANSACTED); + } else { + sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); + } ProducerThread producer = new ProducerThread(sess, ActiveMQDestination.createDestination(destination, ActiveMQDestination.QUEUE_TYPE)); producer.setName("producer-" + i); producer.setMessageCount(messageCount);