Assert.assertNull(consumer1.receiveImmediate());
// Now stop the bridge manually
Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);
BridgeStartTest.log.info("stopping bridge manually");
bridge.stop();
for (int i = numMessages; i < numMessages * 2; i++)
{
ClientMessage message = session0.createMessage(false);
message.putIntProperty(propKey, i);
producer0.send(message);
}
Assert.assertNull(consumer1.receiveImmediate());
bridge.start();
BridgeStartTest.log.info("started bridge");
// The previous messages will get resent, but with duplicate detection they will be rejected
// at the target
for (int i = numMessages; i < numMessages * 2; i++)
{
ClientMessage message = consumer1.receive(1000);
Assert.assertNotNull(message);
Assert.assertEquals(i, message.getObjectProperty(propKey));
message.acknowledge();
}
Assert.assertNull(consumer1.receiveImmediate());
bridge.stop();
for (int i = 0; i < numMessages; i++)
{
ClientMessage message = session0.createMessage(false);
message.putIntProperty(propKey, i);
producer0.send(message);
}
Assert.assertNull(consumer1.receiveImmediate());
bridge.start();
for (int i = 0; i < numMessages; i++)
{
ClientMessage message = consumer1.receive(1000);