hi, we want to handle events of the same type with a parallel consumer and we do it this way
Disruptor<SomeEvent> disruptor = new Disruptor<>(new AsyncPersistenceMessageEventFactory(),
4096, threadFactory(), ProducerType.SINGLE, new YieldingWaitStrategy());
disruptor.handleEventsWithWorkerPool(ourHandler, ourHandler, ourHandler)
.then((event, sequence, endOfBatch) ->
event.clear()
);
Basically, we want every event to be handled once and by one of the three threads (i.e. three ourHandler).
ourHandler is just like this with no logic to do partition and ignore other events etc.
@Override
public void onEvent(SomeEventevent) throws Exception {
//some logic
}
Is this a correct way to handle what we want?