Package javax.jms

Examples of javax.jms.TextMessage.acknowledge()


       TextMessage m =  (TextMessage)queueConsumer.receive(1500);
       assertEquals(m.getText(), "One");

       queueConsumer.close();

       m.acknowledge();

       try
       {
          queueConsumer.receive(2000);
          fail("should throw exception");
View Full Code Here


         
          assertEquals(tm3.getText(), r3.getText());

          r1.acknowledge();
          r2.acknowledge();
          r3.acknowledge();
       }
       finally
       {
          if (conn != null)
          {
View Full Code Here

                  sess.commit();
               }
               else
               {
                  log.trace("Acknowledging session");
                  tm.acknowledge();
               }
               latch.release();
            }
            count++;
         }
View Full Code Here

  
         assertNotNull(tm3);
  
         assertEquals("Your mum", tm3.getText());
  
         tm3.acknowledge();
      }
      finally
      {

         if (conn != null)
View Full Code Here

      assertNotNull(tm3);

      assertEquals("Your mum", tm3.getText());

      tm3.acknowledge();

      conn.close();

   }
View Full Code Here

               {
                  log.trace("Expected a but got " + tm.getText());
                  failed = true;
                  latch.release();
               }    
               tm.acknowledge();
               assertRemainingMessages(2);
               sess.recover();
            }
            if (count == 5)
            {
View Full Code Here

               {
                  log.trace("Expected c but got " + tm.getText());
                  failed = true;
                  latch.release();
               }
               tm.acknowledge();
               assertRemainingMessages(0);
               latch.release();
            }
              
         }
View Full Code Here

         log.info("here2");

         //Now should be able to acknowledge them

         tm.acknowledge();

         //Now check there are no more messages there
         sess.close();

         sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

      ObjectName on = new ObjectName("jboss.messaging.destination:service=Queue,name=JMSTestQueue");
      Integer mc = (Integer)ServerManagement.getAttribute(on, "MessageCount");

      assertEquals(1, mc.intValue());

      m.acknowledge();

      // make sure there's nothing in queue anymore
      mc = (Integer)ServerManagement.getAttribute(on, "MessageCount");

      assertEquals(0, mc.intValue());
View Full Code Here

         assertEquals(0, ((JBossConnection)conn).getServerID());

         // acknowledge the messages
         clik.acknowledge();
         clak.acknowledge();

         // make sure no messages are left in the queue
         Message m = cons.receive(1000);
         assertNull(m);
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.