1 18 package org.apache.activemq.perf; 19 20 import javax.jms.ConnectionFactory ; 21 import javax.jms.Destination ; 22 import javax.jms.JMSException ; 23 import javax.jms.Message ; 24 27 public class SlowConsumer extends PerfConsumer{ 28 public SlowConsumer(ConnectionFactory fac,Destination dest,String consumerName) 29 throws JMSException { 30 super(fac,dest,consumerName); 31 } 32 33 public SlowConsumer(ConnectionFactory fac,Destination dest) throws JMSException { 34 super(fac,dest,null); 35 } 36 37 public void onMessage(Message msg){ 38 super.onMessage(msg); 39 System.err.println("GOT A MSG " + msg); 40 try{ 41 Thread.sleep(10000); 42 }catch(InterruptedException e){ 43 e.printStackTrace(); 44 } 45 } 46 } 47 | Popular Tags |