{"record":{"id":"fddb1d9fb9d0475a","repo":"flowable/flowable-engine","slug":"message-dispatcher-is-disabled-cannot-dispatch-ev-fddb1d","errorCode":null,"errorMessage":"Message dispatcher is disabled, cannot dispatch event","messagePattern":"Message dispatcher is disabled, cannot dispatch event","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/DispatchEventCommand.java","lineNumber":44,"sourceCode":" */\npublic class DispatchEventCommand implements Command<Void> {\n\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 ActivitiIllegalArgumentException(\"event is null\");\n        }\n\n        if (commandContext.getEventDispatcher().isEnabled()) {\n            commandContext.getEventDispatcher().dispatchEvent(event, EngineConfigurationConstants.KEY_PROCESS_ENGINE_CONFIG);\n        } else {\n            throw new ActivitiException(\"Message dispatcher is disabled, cannot dispatch event\");\n        }\n\n        return null;\n    }\n\n}\n","sourceCodeStart":26,"sourceCodeEnd":51,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/DispatchEventCommand.java#L26-L51","documentation":"This command requires the process engine's event dispatcher to be enabled. If eventDispatcher.isEnabled() is false (events support turned off in configuration), dispatching is impossible and an ActivitiException is thrown rather than silently dropping the event.","triggerScenarios":"Calling runtimeService.dispatchEvent(event) on an engine configured with event support disabled, i.e. processEngineConfiguration.setEventDispatcherEnabled(false) or an equivalent Spring Boot property.","commonSituations":"Teams that disabled event logging/Dispatch for performance, then deployed code (custom listeners, integrations) that still dispatches events; copy-pasted configuration across environments.","solutions":["Enable the event dispatcher: processEngineConfiguration.setEventDispatcherEnabled(true)","Remove or gate the dispatchEvent call behind a check of configuration.isEventDispatcherEnabled()","Align configuration between environments so event support is enabled wherever dispatch code runs"],"exampleFix":"// before\nruntimeService.dispatchEvent(event);\n// after\nif (processEngine.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {\n    runtimeService.dispatchEvent(event);\n}","handlingStrategy":"validation","validationCode":"if (!processEngine.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) { throw new IllegalStateException(\"Event dispatcher is disabled\"); }","typeGuard":"boolean canDispatch(ProcessEngine pe) { return pe.getProcessEngineConfiguration().getEventDispatcher().isEnabled(); }","tryCatchPattern":"try { runtimeService.dispatchEvent(event); } catch (ActivitiException e) { LOGGER.warn(\"Event dispatch failed: {}\", e.getMessage()); }","preventionTips":["Keep event dispatcher enabled in all environments that run dispatching code","Gate dispatch calls behind an isEventDispatcherEnabled() check","Document configuration dependencies for any module dispatching events"],"tags":["event-dispatch","configuration","feature-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"}