12571258125912601261126212631264126512661267
for (int i = 0; i < numberOfMessages; i++) { if (i % 500 == 0) { session.commit(); } message = session.createMessage(true); HornetQBuffer bodyLocal = message.getBodyBuffer();
12701271127212731274127512761277127812791280
message.putIntProperty(new SimpleString("id"), i); producer.send(message); } session.commit(); session.close(); server.stop();
13171318131913201321132213231324132513261327
message2.acknowledge(); Assert.assertNotNull(message2); if (i % 1000 == 0) session.commit(); try { assertBodiesEqual(body, message2.getBodyBuffer()); }
13331334133513361337133813391340134113421343
.array(), 40)); throw e; } } session.commit(); consumer.close(); session.close(); }
14861487148814891490149114921493149414951496
16321633163416351636163716381639164016411642
ClientConsumer consumer = session.createConsumer(PagingTest.ADDRESS); Assert.assertNull(consumer.receiveImmediate()); sessionTransacted.commit(); sessionTransacted.close(); for (int i = 0; i < 10; i++) {
20212022202320242025202620272028202920302031
msg.putIntProperty("count", i); producer.send(msg); if (i % 100 == 0 && i != 0) { sessionProducer.commit(); // Thread.sleep(500); } } sessionProducer.commit();
20262027202820292030203120322033203420352036
sessionProducer.commit(); // Thread.sleep(500); } } sessionProducer.commit(); System.out.println("Producer gone"); } catch (Throwable e)
20702071207220732074207520762077207820792080
assertNotNull(msg); assertEquals(i, msg.getIntProperty("count").intValue()); msg.acknowledge(); if (i > 0 && i % 10 == 0) { session.commit(); } } session.commit(); session.close();
20732074207520762077207820792080208120822083
if (i > 0 && i % 10 == 0) { session.commit(); } } session.commit(); session.close(); producerThread.join();