Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.ConsumerInfoWriter.writePacketToByteArray()


    info.setStarted(this.started);
   
    ConsumerInfoWriter writer = new ConsumerInfoWriter();
    ConsumerInfoReader reader = new ConsumerInfoReader();
    try {
    byte[] data = writer.writePacketToByteArray(info);
    ConsumerInfo testInfo = (ConsumerInfo) reader.readPacketFromByteArray(data);
   
      assertTrue(testInfo.getId().equals(this.consumerId));
      assertTrue(testInfo.getConsumerNo()==this.consumerNo);
            assertTrue(testInfo.getPrefetchNumber() == this.prefetchNumber);
View Full Code Here


    ConsumerInfo testInfo = null;
    try {
      int count = 100000;
      long startTime = System.currentTimeMillis();
      for (int i = 0; i < count; i++){
        byte[] data = writer.writePacketToByteArray(info);
        testInfo = (ConsumerInfo) reader.readPacketFromByteArray(data);
      }
      long finishTime = System.currentTimeMillis();
      long totalTime = finishTime-startTime;
      long ps = (count * 1000)/totalTime;
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.