log.info("Message is:" + m);
      public void onMessage(Message m)      {         try         {            count++;                        TextMessage tm = (TextMessage)m;                        log.trace("Got message:" + tm.getText());                        //Receive first three messages then recover() session            //Only last message should be redelivered            if (count == 1)            {               if (!"a".equals(tm.getText()))               {                  failed = true;                  latch.release();               }            }            if (count == 2)            {               if (!"b".equals(tm.getText()))               {                  failed = true;                  latch.release();               }            }            if (count == 3)            {               if (!"c".equals(tm.getText()))               {                  failed = true;                  latch.release();               }               sess.recover();            }            if (count == 4)            {               if (!"c".equals(tm.getText()))               {                  failed = true;                  latch.release();               }               latch.release();            }                                    }         catch (JMSException e)         {            failed = true;            latch.release();         }      }