InProcessChronicleSource source = new InProcessChronicleSource(chronicle, PORT);
source.busyWaitTimeNS(2 * 1000 * 1000);
EventsWriter writer = new EventsWriter(source);
Update update = new Update();
System.out.println("Allowing connection.");
Thread.sleep(1000);
System.out.println("Warming up.");
for (int i = -WARMUP; i <= MESSAGES; i += RATE) {
if (i == 0)
System.out.println("Sending messages.");
Thread.sleep(1);
for (int j = 0; j < RATE; j++) {
update.resetLevels("EUR/USD");
update.acquireLevel().init(1.3256, 1e6, 1.3257, 2e6);
update.acquireLevel().init(1.3255, 2e6, 1.3258, 4e6);
update.acquireLevel().init(1.3254, 3e6, 1.3259, 6e6);
update.acquireLevel().init(1.3253, 4e6, 1.3260, 8e6);
update.acquireLevel().init(1.3252, 5e6, 1.3261, 10e6);
writer.onMarketData(null, update);
pause(10 * 1000);
}
}
System.out.println("Messages written");