prod.send(msg);
}
session.commit();
ReplicationEndpointImpl endpoint = null;
if (failBeforeConsume)
{
failSession(session, latch);
}
else
{
endpoint = (ReplicationEndpointImpl)((HornetQServerImpl)server1Service).getReplicationEndpoint();
if (endpoint != null)
{
endpoint.setDeletePages(false);
}
}
session.start();
ClientConsumer cons = session.createConsumer(PagingFailoverTest.ADDRESS);
final int MIDDLE = TOTAL_MESSAGES / 2;
for (int i = 0; i < MIDDLE; i++)
{
ClientMessage msg = cons.receive(20000);
Assert.assertNotNull(msg);
msg.acknowledge();
if (transacted && i % 10 == 0)
{
session.commit();
}
Assert.assertEquals(i, msg.getObjectProperty(new SimpleString("key")));
}
session.commit();
if (endpoint != null)
{
endpoint.setDeletePages(true);
}
if (!failBeforeConsume)
{
failSession(session, latch);