Export to GitHub

disruptor - issue #9

Disruptor DSL not working with SequenceReportingEventHandler


Posted on Sep 12, 2011 by Happy Horse

Calling disruptor.handleEventsWith(aSequenceReportingEventHandler) does not call the correct BatchEventProcessor constructor. This problem is caused by Java's static binding for overloaded methods/constructors.

The temporary solution was to replace line 254 of Disruptor.java with this...

        final BatchEventProcessor<T> batchEventProcessor;
        if (eventHandler instanceof SequenceReportingEventHandler) {
            batchEventProcessor = new BatchEventProcessor<T>(ringBuffer, barrier, (SequenceReportingEventHandler)eventHandler);
        }else{
            batchEventProcessor = new BatchEventProcessor<T>(ringBuffer, barrier, eventHandler);
        }

Not sure if there is a better way.

Comment #1

Posted on Sep 15, 2011 by Helpful Rhino

Will make it into 2.5.1

Status: Fixed

Labels:
Type-Defect Priority-Medium