Package javax.jms

Examples of javax.jms.Session.recover()


        assertFalse("Message should not be redelivered.", msg.getJMSRedelivered());
        // Don't ack the message.

        // Reset the session. This should cause the Unacked message to be
        // redelivered.
        session.recover();

        // Attempt to Consume the message...
        msg = consumer.receive(2000);
        assertNotNull(msg);
        assertTrue("Message should be redelivered.", msg.getJMSRedelivered());
View Full Code Here


        assertFalse("Message should not be redelivered.", msg.getJMSRedelivered());
        // Don't ack the message.

        // Reset the session. This should cause the Unacked message to be
        // redelivered.
        session.recover();

        // Attempt to Consume the message...
        msg = consumer.receive(2000);
        assertNotNull(msg);
        assertTrue("Message should be redelivered.", msg.getJMSRedelivered());
View Full Code Here

                {
                    session.rollback();
                }
                else if (session.getAcknowledgeMode() == Session.CLIENT_ACKNOWLEDGE)
                {
                    session.recover();
                }
            }
        }
        catch (final JMSException jmse)
        {
View Full Code Here

        //Send 1
        sendAndCommitMessage(producer,"4");

        //Receive 1 and recover
        received = assertReceiveAndValidateMessage(consumer, "4");
        consumerSession.recover();

        //Receive same 1
        received = assertReceiveAndValidateMessage(consumer, "4");
        received.acknowledge();
View Full Code Here

        sendAndCommitMessage(producer,"6");
        sendAndCommitMessage(producer,"5");

        //Receive 1 of 3 (possibly out of order due to pre-fetch)
        final Message messageBeforeRollback = assertReceiveMessage(consumer);
        consumerSession.recover();

        if (isBroker010())
        {
            //Receive 3 in sorted order (not as per JMS recover)
            received = assertReceiveAndValidateMessage(consumer, "5");
View Full Code Here

                    else if(_sessionType == Session.CLIENT_ACKNOWLEDGE)
                    {
                         if (_count%10 == 0)
                         {
                             LOGGER.debug("client ack session recover");
                             session.recover();
                         }
                         else
                         {
                             LOGGER.debug("client ack session acknowledge");
                             msg.acknowledge();
View Full Code Here

         ProxyAssertSupport.assertEquals(1, rm.getIntProperty("JMSXDeliveryCount"));

         ProxyAssertSupport.assertFalse(rm.getJMSRedelivered());

         consumerSess.recover();

         rm = (TextMessage)consumer.receive(1000);

         ProxyAssertSupport.assertNotNull(rm);
View Full Code Here

         ProxyAssertSupport.assertEquals(2, rm.getIntProperty("JMSXDeliveryCount"));

         ProxyAssertSupport.assertTrue(rm.getJMSRedelivered());

         consumerSess.recover();

         rm = (TextMessage)consumer.receive(1000);

         ProxyAssertSupport.assertNotNull(rm);
View Full Code Here

         ProxyAssertSupport.assertEquals("xoxo", tm.getText());
         ProxyAssertSupport.assertTrue("JMSXDeliveryCount is supposed to exist as a property",
                                       tm.propertyExists("JMSXDeliveryCount"));
         ProxyAssertSupport.assertEquals(1, tm.getIntProperty("JMSXDeliveryCount"));

         s.recover();

         tm = (TextMessage)c.receive(1000);

         ProxyAssertSupport.assertEquals("xoxo", tm.getText());
         ProxyAssertSupport.assertTrue("JMSXDeliveryCount is supposed to exist as a property",
View Full Code Here

                                             tm.propertyExists("JMSXDeliveryCount"));
               ProxyAssertSupport.assertEquals(j + 1, tm.getIntProperty("JMSXDeliveryCount"));
            }
            if (j != NUM_RECOVERIES - 1)
            {
               sess2.recover();
            }
         }

         tm.acknowledge();
      }
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.