{
System.out.println("Iteration " + i);
// Sending non transactionally, so it would test non transactional stuff on the journal
for (int j = 0; j < 1000; j++)
{
Message msg = session.createMessage(true);
msg.getBodyBuffer().writeBytes(new byte[1024]);
prod.send(msg);
}
// I need to guarantee a roundtrip to the server, to make sure everything is persisted
session.commit();
for (int j = 0; j < 1000; j++)
{
ClientMessage msg = cons.receive(2000);
Assert.assertNotNull(msg);
msg.acknowledge();
}
// I need to guarantee a roundtrip to the server, to make sure everything is persisted
session.commit();
}
Assert.assertNull(cons.receiveImmediate());
session.close();
server.stop();
setupServer(journalType);
server.start();
session = sf.createSession(false, true, true);
cons = session.createConsumer(CompactingStressTest.Q1);
session.start();
for (int i = 0; i < 500; i++)
{
ClientMessage msg = cons.receive(1000);
Assert.assertNotNull(msg);
msg.acknowledge();
}
Assert.assertNull(cons.receiveImmediate());
prod = session.createProducer(CompactingStressTest.AD2);