final int NUM_MESSAGES = 10;
final int NUM_MESSAGES = 1000;
   public void testRedeliveryOnQueue() throws Exception   {      Connection conn = cf.createConnection();            Session sess1 = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);            MessageProducer prod = sess1.createProducer(queue);            prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);            final int NUM_MESSAGES = 10;            final int NUM_RECOVERIES = 8;            for (int i = 0; i < NUM_MESSAGES; i++)      {         TextMessage tm = sess1.createTextMessage();         tm.setText("testing" + i);         prod.send(tm);      }            Session sess2 = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);            MessageConsumer cons = sess2.createConsumer(queue);            conn.start();            for (int j = 0; j < NUM_RECOVERIES; j++)      {               for (int i = 0; i < NUM_MESSAGES; i++)         {            TextMessage tm = (TextMessage)cons.receive(3000);            assertNotNull(tm);            assertEquals("testing" + i, tm.getText());            assertEquals(j, tm.getIntProperty("JMSXDeliveryCount"));         }         sess2.recover();      }            conn.close();               }