flowable/flowable-engine · error · FlowableException

Message dispatcher is disabled, cannot dispatch event.

Error message

Message dispatcher is disabled, cannot dispatch event.

What it means

FlowableException thrown by DispatchEventCommand.execute when the configured FlowableEventDispatcher is null or disabled, so the event cannot be delivered. This is a feature/configuration gate, not an argument problem: the engine was set up without an enabled event dispatcher.

Solutions

  1. Enable the event dispatcher in the CmmnEngineConfiguration (eventDispatcher.setEnabled(true) / register a FlowableEventDispatcher)
  2. Check eventDispatcher != null && isEnabled() before dispatching
  3. Remove or guard dispatch calls in configurations where events are intentionally off

Example fix

// before
cmmnEngineConfiguration.getEventDispatcher().dispatchEvent(event, key);
// after
FlowableEventDispatcher d = cmmnEngineConfiguration.getEventDispatcher();
if (d != null && d.isEnabled()) {
    d.dispatchEvent(event, key);
}
Defensive patterns

Strategy: validation

Validate before calling

FlowableEventDispatcher d = cfg.getEventDispatcher(); if (d == null || !d.isEnabled()) throw new IllegalStateException("event dispatcher disabled");

Type guard

boolean dispatcherReady = cfg.getEventDispatcher() != null && cfg.getEventDispatcher().isEnabled();

Try / catch

try { dispatcher.dispatchEvent(event, key); } catch (FlowableException e) { log.error("event dispatcher disabled in this configuration", e); }

Prevention

When it happens

Trigger: Calling dispatchEvent on a CmmnEngineConfiguration where the event dispatcher was never registered or where eventDispatcher.setEnabled(false) was set in the configuration.

Common situations: Embedding the CMMN engine without the spring/process event infrastructure; deliberately disabling events in tests and leaving dispatch calls in place; a config profile that omits the event dispatcher bean.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/e8baa8ce84134925. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DispatchEventCommand.java:48

    protected FlowableEvent event;

    public DispatchEventCommand(FlowableEvent event) {
        this.event = event;
    }

    @Override
    public Void execute(CommandContext commandContext) {
        if (event == null) {
            throw new FlowableIllegalArgumentException("The event to be dispatched must not be null.");
        }

        CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);
        FlowableEventDispatcher eventDispatcher = cmmnEngineConfiguration.getEventDispatcher();
        if (eventDispatcher != null && eventDispatcher.isEnabled()) {
            eventDispatcher.dispatchEvent(event, cmmnEngineConfiguration.getEngineCfgKey());
        } else {
            throw new FlowableException("Message dispatcher is disabled, cannot dispatch event.");
        }

        return null;
    }
}

View on GitHub (pinned to d6d39ce1c6)