waitStrategy);
// Initial barrier
SequenceBarrier translationBarrier = ringBuffer.newBarrier();
EventProcessor tradeProcessor = createTradeProcessor(ringBuffer, translationBarrier);
EventProcessor rateProcessor = createRateProcessor(ringBuffer, translationBarrier);
// Add the portfolio position aggregator with a barrier after both
// processors.
SequenceBarrier positionBarrier = ringBuffer.newBarrier(tradeProcessor.getSequence(),
rateProcessor.getSequence());
EventProcessor portfolioPositionProcessor = createPortfolioPositionProcessor(ringBuffer, positionBarrier);
// Netty Event Publisher
TextMessageGateway gateway = createGatewayEventPublisher(ringBuffer);
// The producer can't move past this barrier.
ringBuffer.setGatingSequences(tradeProcessor.getSequence(), rateProcessor.getSequence(),
portfolioPositionProcessor.getSequence());
// Start the threads
tasks[0] = threadPool.submit(gateway);
tasks[1] = threadPool.submit(tradeProcessor);
tasks[2] = threadPool.submit(rateProcessor);