{"record":{"id":"5977d5c10c13067f","repo":"flowable/flowable-engine","slug":"message-dispatcher-is-disabled-cannot-dispatch","errorCode":null,"errorMessage":"Message dispatcher is disabled, cannot dispatch ${event}","messagePattern":"Message dispatcher is disabled, cannot dispatch (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/DispatchEventCommand.java","lineNumber":48,"sourceCode":"\n    protected FlowableEvent event;\n\n    public DispatchEventCommand(FlowableEvent event) {\n        this.event = event;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        if (event == null) {\n            throw new FlowableIllegalArgumentException(\"event is null\");\n        }\n\n        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\n        FlowableEventDispatcher eventDispatcher = processEngineConfiguration.getEventDispatcher();\n        if (eventDispatcher != null && eventDispatcher.isEnabled()) {\n            eventDispatcher.dispatchEvent(event, processEngineConfiguration.getEngineCfgKey());\n        } else {\n            throw new FlowableException(\"Message dispatcher is disabled, cannot dispatch \" + event);\n        }\n\n        return null;\n    }\n\n}\n","sourceCodeStart":30,"sourceCodeEnd":55,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/DispatchEventCommand.java#L30-L55","documentation":"DispatchEventCommand requires an enabled event dispatcher: if the engine's FlowableEventDispatcher is null or disabled (isEnableEventDispatcher() false), the event cannot be delivered and this FlowableException is thrown instead of silently dropping the event.","triggerScenarios":"Calling runtimeService.dispatchEvent(event) when eventDispatcher is null or isEnabled() is false — e.g. the engine config didn't enable the event registry/dispatcher, or the deployed configuration created a dispatcher-less engine.","commonSituations":"Lightweight/embedded engine configs where event dispatch was disabled for performance; tests using minimal config; event listeners expected but useEventDispatcher/enableEventDispatcher never set true; Spring config missing the eventRegistry initializer.","solutions":["Enable the event dispatcher in configuration: setEnableEventDispatcher(true) (or event registry equivalent) on ProcessEngineConfiguration.","Verify configuration at startup — processEngineConfiguration.getEventDispatcher() != null && isEnabled().","If events are intentionally unused, remove or guard the dispatch calls instead of expecting silent no-ops.","Check the deployed config file/Spring beans for a conflicting event-dispatcher=false property."],"exampleFix":"// before\nProcessEngineConfigurationImpl cfg = ...; // event dispatcher disabled\ncfg.setEnableEventDispatcher(false);\nruntimeService.dispatchEvent(event); // throws\n// after\ncfg.setEnableEventDispatcher(true);\nruntimeService.dispatchEvent(event);","handlingStrategy":"validation","validationCode":"ProcessEngineConfigurationImpl cfg = ...;\nif (cfg.getEventDispatcher() == null || !cfg.getEventDispatcher().isEnabled()) {\n    throw new IllegalStateException(\"Event dispatcher must be enabled to dispatch events\");\n}","typeGuard":null,"tryCatchPattern":"try { rs.dispatchEvent(event); } catch (FlowableException e) { log.warn(\"Dispatcher disabled, event dropped: {}\", event); }","preventionTips":["Enable the event dispatcher in engine configuration","Check dispatcher status once at startup before registering event-producing flows","Remove dispatch calls in configs where events are intentionally disabled"],"tags":["workflow","events","configuration","dispatcher-disabled"],"backgroundTag":"feature-not-enabled","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}