{"record":{"id":"e845777d1a56400f","repo":"LMAX-Exchange/disruptor","slug":"the-event-handler-is-not-processing-events","errorCode":null,"errorMessage":"The event handler {} is not processing events.","messagePattern":"The event handler (.+?) is not processing events\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/main/java/com/lmax/disruptor/dsl/ConsumerRepository.java","lineNumber":94,"sourceCode":"                for (Sequence sequence : sequences)\n                {\n                    if (cursor > sequence.get())\n                    {\n                        return true;\n                    }\n                }\n            }\n        }\n\n        return false;\n    }\n\n    public EventProcessor getEventProcessorFor(final EventHandlerIdentity handlerIdentity)\n    {\n        final EventProcessorInfo eventprocessorInfo = getEventProcessorInfo(handlerIdentity);\n        if (eventprocessorInfo == null)\n        {\n            throw new IllegalArgumentException(\"The event handler \" + handlerIdentity + \" is not processing events.\");\n        }\n\n        return eventprocessorInfo.getEventProcessor();\n    }\n\n    public Sequence getSequenceFor(final EventHandlerIdentity handlerIdentity)\n    {\n        return getEventProcessorFor(handlerIdentity).getSequence();\n    }\n\n    public void unMarkEventProcessorsAsEndOfChain(final Sequence... barrierEventProcessors)\n    {\n        for (Sequence barrierEventProcessor : barrierEventProcessors)\n        {\n            getEventProcessorInfo(barrierEventProcessor).markAsUsedInBarrier();\n        }\n    }\n","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/LMAX-Exchange/disruptor/blob/c871ca49826a6be7ada6957f6fbafcfecf7b1f87/src/main/java/com/lmax/disruptor/dsl/ConsumerRepository.java#L76-L112","documentation":"Thrown by ConsumerRepository.getEventProcessorFor when no registered event processor matches the given EventHandlerIdentity (the handler instance). The DSL tracks every handler added via handleEventsWith/handleEventsWithWorkerPool; asking for the processor or sequence of an unregistered handler means the wiring never happened or the wrong instance was passed.","triggerScenarios":"Calling disruptor.getSequenceFor(handler) or after(handler)/handleEventsWith after an unknown handler instance — e.g. passing a new instance (handlers are tracked by identity, not equals), or querying a handler that was never added via the DSL because it was wired manually with a custom EventProcessor.","commonSituations":"Passing a freshly constructed handler where the registered one lives in a field; lambda handlers (each lambda is a distinct object, so re-specifying the lambda later never matches); mixing DSL wiring with manual RingBuffer/BatchEventProcessor wiring.","solutions":["Reuse the exact handler instance you registered with handleEventsWith when calling getSequenceFor/after.","Store handlers in named fields instead of inline lambdas when you need to query them later.","For manually wired processors, keep their Sequence references directly instead of asking the Disruptor."],"exampleFix":"// before\ndisruptor.handleEventsWith(event -> process(event));\n...\nSequence s = disruptor.getSequenceFor(event -> process(event)); // new lambda -> never matches\n\n// after\nEventHandler<MyEvent> handler = event -> process(event);\ndisruptor.handleEventsWith(handler);\nSequence s = disruptor.getSequenceFor(handler);","handlingStrategy":"type-guard","validationCode":"EventHandler<MyEvent> handler = new MyHandler(); // one instance\ndisruptor.handleEventsWith(handler);\n// later reuse the SAME instance:\nSequence seq = disruptor.getSequenceFor(handler);","typeGuard":"static boolean isRegistered(Disruptor<?> d, EventHandler<?> h) {\n    try { d.getSequenceFor(h); return true; }\n    catch (IllegalArgumentException e) { return false; }\n}","tryCatchPattern":"try {\n    Sequence seq = disruptor.getSequenceFor(handler);\n} catch (IllegalArgumentException e) {\n    // handler was never registered (or wrong instance) — fix wiring, do not swallow\n    throw new IllegalStateException(\"handler not registered with Disruptor: \" + handler, e);\n}","preventionTips":["Store handlers in named fields; avoid re-specifying inline lambdas when querying sequences.","Remember handlers are matched by instance identity, not equals()."],"tags":["disruptor","dsl","event-handler","identity","configuration"],"backgroundTag":null,"analyzedSha":"c871ca49826a6be7ada6957f6fbafcfecf7b1f87","analyzedAt":"2026-08-14T14:22:36.358Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}