Reputation: 29
We have been using LMAX Disruptor in production for nearly a year now. Everything has been fine until last week when we saw messages dropped from Disruptor. Our Disruptor structure is pretty straightforward:
Kafka -> RingBuffer -> Eventhandler1 -> Eventhandler2 -> Eventhandler3
Each Eventhandler has a try-catch block to catch all Exceptions. The slowest is the Eventhandler2 which takes ~3 milliseconds for each message.
We sent 53 messages to Kafaka, all of them were processed by Eventhandler1. But somehow only 23 messages were picked up by Eventhandler2 and Eventhandler3, and we didn't see any Exceptions in logs.
We tried to reproduce this in our development environment but we did not see this issue.
So my questions are:
Upvotes: 3
Views: 369
Reputation: 1488
Same issue I had on production and on testing env with load test. It can drop or behave unpredictable in case you have 2 or more concurrent producers (ring buffer publishers) but Disruptor is initialized with ProducerType.SINGLE. Please check that.
ProducerType.MULTI usage example:
Disruptor<CustomEvent> disruptor = new Disruptor<CustomEvent>(eventFactory, bufferSize, executor, ProducerType.MULTI, new BlockingWaitStrategy());
Upvotes: 1