this.messages = new ArrayList<Message>();
final CountDownLatch latch = new CountDownLatch(count);
for (int i = 0; i < count; i++) {
final byte[] data = (strdata + i).getBytes();
final Message msg = new Message(topic, data);
this.producer.sendMessage(msg, new SendMessageCallback() {
public void onMessageSent(final SendResult result) {
latch.countDown();
if (!result.isSuccess()) {
throw new RuntimeException("Send message failed:" + result.getErrorMessage());
}