CountDownLatch startLatch = new CountDownLatch(1);
CountDownLatch everyoneDoneLatch = new CountDownLatch(numberOfPartitions);
for (int i = 0; i < numberOfPartitions; i++) {
Messages msgs = new Messages(TextMessage.class);
for (int p = 0; p < numOfMessagesToSendPerThread; p++) {
TextMessage txtmsg = new TextMessage(Integer.toString(i), new Text("test message "
+ Integer.toString(p)));
msgs.add(txtmsg);
}
OutboundMessageThread obmThread = new OutboundMessageThread(msgs, omq, startLatch, everyoneDoneLatch);