Package javax.jms

Examples of javax.jms.Session.commit()


         // failover complete
         assertEquals(0, getServerId(conn));

         // acknowledge the messages
         session.commit();

         // make sure no messages are left in the queue
         checkEmpty(queue[1], 0);
      }
      finally
View Full Code Here


         prod.setDeliveryMode(DeliveryMode.PERSISTENT);
         prod.send(session.createTextMessage("clik-persistent"));
         prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
         prod.send(session.createTextMessage("clak-non-persistent"));

         session.commit();

         // close the producer
         prod.close();

         // create a consumer and receive messages, but don't acknowledge
View Full Code Here

         TextMessage m = (TextMessage)cons.receive(2000);
         assertNotNull(m);
         assertEquals("clik-persistent", m.getText());

         session.commit();

         checkEmpty(queue[1], 0);
      }
      finally
      {
View Full Code Here

         MessageConsumer consumer = session.createConsumer(queue[0]);

         producer.send(session.createTextMessage("before-poison1"));
         producer.send(session.createTextMessage("before-poison2"));
         producer.send(session.createTextMessage("before-poison3"));
         session.commit();

         Thread.sleep(2000);

         for (int i = 1; i <= 3; i++)
         {
View Full Code Here

            assertEquals("before-poison" + i, tm.getText());
         }

         assertNull(consumer.receive(3000));

         session.commit();
      }
      finally
      {
         if (conn != null)
         {
View Full Code Here

         MessageConsumer consumer = session.createConsumer(queue[0]);

         producer.send(session.createTextMessage("before-poison1"));
         producer.send(session.createTextMessage("before-poison2"));
         producer.send(session.createTextMessage("before-poison3"));
         session.commit();

         Thread.sleep(2000);

         for (int i = 1; i <= 3; i++)
         {
View Full Code Here

            assertEquals("before-poison" + i, tm.getText());
         }

         assertNull(consumer.receive(3000));

         session.commit();
      }
      finally
      {
         if (conn != null)
         {
View Full Code Here

         //now commit

         session1.commit();

         session2.commit();

         session1.close();

         session2.close();;
View Full Code Here

            producer.send(message);
            message = session.createMessage();
            message.setBooleanProperty("testprop", false);
            producer.send(message);
        }
        session.commit();
        producer.close();

        // should be 5 or 10 messages on queue now
        // (5 for the java broker due to use of server side selectors, and 10 for the cpp broker due to client side selectors only)
        AMQQueue queue = new AMQQueue("amq.topic", "clientid" + ":" + "sameMessageSelector");
View Full Code Here

                assertEquals("sameMessageSelector test failed. message selector not reset",
                        "true", message.getStringProperty("testprop"));
            }
        }
       
        session.commit();
       
        // Check queue has no messages
        if (isJavaBroker())
        {
            assertEquals("Queue should be empty", 0, ((AMQSession<?, ?>) session).getQueueDepth(queue));
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.