ack.setConsumerId(this.consumerId);
ack.setTransactionId(this.transactedId);
ack.setMessageID(messageId);
ack.setMessageRead(this.messageRead);
MessageAckWriter writer = new MessageAckWriter();
MessageAckReader reader = new MessageAckReader();
try {
int count = 100000;
long startTime = System.currentTimeMillis();
for (int i = 0; i < count; i++) {
byte[] data = writer.writePacketToByteArray(ack);
MessageAck mack = (MessageAck) reader.readPacketFromByteArray(data);
}
long finishTime = System.currentTimeMillis();
long totalTime = finishTime - startTime;
long ps = (count * 1000) / totalTime;