Package org.hornetq.api.core.client

Examples of org.hornetq.api.core.client.ClientSession.commit()


            for (int i = 0; i < numberOfMessages; i++)
            {
               if (i % 500 == 0)
               {
                  session.commit();
               }
               message = session.createMessage(true);

               HornetQBuffer bodyLocal = message.getBodyBuffer();
View Full Code Here


               message.putIntProperty(new SimpleString("id"), i);

               producer.send(message);
            }

            session.commit();

            session.close();

            server.stop();
View Full Code Here

                     message2.acknowledge();

                     Assert.assertNotNull(message2);

                     if (i % 1000 == 0)
                        session.commit();

                     try
                     {
                        assertBodiesEqual(body, message2.getBodyBuffer());
                     }
View Full Code Here

                                                                                                   .array(), 40));
                        throw e;
                     }
                  }

                  session.commit();

                  consumer.close();

                  session.close();
               }
View Full Code Here

            message2.acknowledge();

            Assert.assertNotNull(message2);

            if (i % 1000 == 0)
               session.commit();

            try
            {
               assertBodiesEqual(body, message2.getBodyBuffer());
            }
View Full Code Here

         ClientConsumer consumer = session.createConsumer(PagingTest.ADDRESS);

         Assert.assertNull(consumer.receiveImmediate());

         sessionTransacted.commit();

         sessionTransacted.close();

         for (int i = 0; i < 10; i++)
         {
View Full Code Here

                     msg.putIntProperty("count", i);
                     producer.send(msg);

                     if (i % 100 == 0 && i != 0)
                     {
                        sessionProducer.commit();
                        // Thread.sleep(500);
                     }
                  }

                  sessionProducer.commit();
View Full Code Here

                        sessionProducer.commit();
                        // Thread.sleep(500);
                     }
                  }

                  sessionProducer.commit();

                  System.out.println("Producer gone");

               }
               catch (Throwable e)
View Full Code Here

            assertNotNull(msg);
            assertEquals(i, msg.getIntProperty("count").intValue());
            msg.acknowledge();
            if (i > 0 && i % 10 == 0)
            {
               session.commit();
            }
         }
         session.commit();

         session.close();
View Full Code Here

            if (i > 0 && i % 10 == 0)
            {
               session.commit();
            }
         }
         session.commit();

         session.close();

         producerThread.join();
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.