Connection cnx = cf.createConnection();
Session session = (Session) cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
// session.setImplicitAck(true);
session.setQueueMessageReadMax(100);
MessageConsumer consumer = (MessageConsumer) session.createConsumer(queue);
consumer.setMessageListener(new MyListener());
cnx.start();
System.in.read();
session.close();