consumerSession.commit();
   public void testSendMessageAndCloseConsumer2() throws Exception   {      // create my consumer from scratch      consumerConnection.close();      TextMessage tm = producerSession.createTextMessage();      tm.setText("One");      queueProducer.send(tm);      tm.setText("Two");      queueProducer.send(tm);      consumerConnection = cf.createConnection();      consumerSession = consumerConnection.createSession(true, 0);      queueConsumer = consumerSession.createConsumer(queue);      consumerConnection.start();      TextMessage m =  (TextMessage)queueConsumer.receive(1500);      assertEquals(m.getText(), "One");      queueConsumer.close();      consumerSession.commit();      // I expect that "Two" is still in the queue      MessageConsumer queueConsumer2 = consumerSession.createConsumer(queue);      m =  (TextMessage)queueConsumer2.receive(1500);      assertNotNull(m);      assertEquals(m.getText(), "Two");      consumerConnection.close();   }