Thread[] producerThreads = new Thread[producerCount];
Connection[] producerConnections = new Connection[producerCount];
Channel[] producerChannels = new Channel[producerCount];
for (int i = 0; i < producerCount; i++) {
System.out.println("starting producer #" + i);
Connection conn = factory.newConnection();
producerConnections[i] = conn;
Channel channel = conn.createChannel();
producerChannels[i] = channel;
if (producerTxSize > 0) channel.txSelect();
if (confirm >= 0) channel.confirmSelect();