Package javax.jms

Examples of javax.jms.Message.acknowledge()


       
        assertRemainingMessages(NUM_MESSAGES);
 
      assertNotNull(m);
 
      m.acknowledge();
       
        assertRemainingMessages(0);
 
      log.trace("Received " + count +  " messages");
 
View Full Code Here


           {
              break;
           }
        if (count == ACKED_MESSAGES -1)
           {
              m.acknowledge();
           }
        count++;
      }
       
        assertRemainingMessages(NUM_MESSAGES - ACKED_MESSAGES);
View Full Code Here

                    {
                        case Session.SESSION_TRANSACTED:
                            session.commit();
                            break;
                        case Session.CLIENT_ACKNOWLEDGE:
                            message.acknowledge();
                            break;
                    }
                }

                if (msgId == MSG_COUNT)
View Full Code Here

               count.lastReceived = msgCount.intValue();

               if (innerCount == ackSize - 1)
               {
                  m.acknowledge();
               }
               processingDone();

            }
View Full Code Here

      queueCons = session.createConsumer(HornetQServerTestCase.queue1);
      r = queueCons.receive(1000);

      assertEquivalent(r, DeliveryMode.PERSISTENT, true);

      r.acknowledge();

      ProxyAssertSupport.assertNull(queueCons.receive(100));

   }
  
View Full Code Here

               {
                  sess.recover();
               }

            }
            lastMessage.acknowledge();
         }
         catch (Exception e)
         {
            failed = true;
         }
View Full Code Here

        causeFailure(getFailingPort(), DEFAULT_FAILOVER_TIME);

        Exception failure = null;
        try
        {
            msg.acknowledge();
        }
        catch (Exception e)
        {
            failure = e;
        }
View Full Code Here

        resendMessagesIfNecessary();

        // tests whether receiving and acknowledgment is working after recover
        Message lastMessage = consumeMessages();
        lastMessage.acknowledge();
    }

    /**
     * Test that receiving more messages after failover and then calling
     * {@link Session#recover()} does not throw an exception
View Full Code Here

        // recover should successfully restore session
        _consumerSession.recover();

        // tests whether receiving and acknowledgment is working after recover
        Message lastMessage = consumeMessages();
        lastMessage.acknowledge();
    }

    /**
     * Test that first call to {@link Message#acknowledge()} after failover
     * throws a JMSEXception if session is dirty.
View Full Code Here

        assertFailoverException();

        try
        {
            // an implicit recover performed when acknowledge throws an exception due to failover
            lastMessage.acknowledge();
            fail("JMSException should be thrown");
        }
        catch (JMSException t)
        {
            // TODO: assert error code and/or expected exception type
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.