// we want to wait for the cluster to have switched to replay mode, so we can send some messages to it.
// if we were to publish events right away, there is a big chance the Cluster didn't switch to replay mode, yet.
waitForReplayToHaveStarted(replayingCluster);
// this is a new event, so it should be backlogged and handled at the end of the replay
eventBus.publish(asEventMessage(new ToDoItemCreatedEvent("todo3", "Came in just now...")));
// this message is also part of the replay, and should therefore not be handled twice.
eventBus.publish(domainEventMessages[2]);
// we wait (at most 10 seconds) for the replay to complete.