flowable/flowable-engine · error · FlowableIllegalArgumentException

No event object was passed to the consumer

Error message

No event object was passed to the consumer

What it means

BaseEventRegistryEventConsumer.eventReceived(EventRegistryEvent) throws FlowableIllegalArgumentException when the incoming event's getEventObject() is null. The consumer only knows how to process EventInstance payloads, so a null payload cannot be dispatched to eventReceived(EventInstance).

Source

Thrown at modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/consumer/BaseEventRegistryEventConsumer.java:63

 * @author Filip Hrisafov
 */
public abstract class BaseEventRegistryEventConsumer implements EventRegistryEventConsumer {

    protected AbstractEngineConfiguration engineConfiguration;
    protected CommandExecutor commandExecutor;

    public BaseEventRegistryEventConsumer(AbstractEngineConfiguration engineConfiguration) {
        this.engineConfiguration = engineConfiguration;
        this.commandExecutor = engineConfiguration.getCommandExecutor();
    }

    @Override
    public EventRegistryProcessingInfo eventReceived(EventRegistryEvent event) {
        if (event.getEventObject() != null && event.getEventObject() instanceof EventInstance) {
            return eventReceived((EventInstance) event.getEventObject());
        } else {
            if (event.getEventObject() == null) {
                throw new FlowableIllegalArgumentException("No event object was passed to the consumer");
            } else {
                throw new FlowableIllegalArgumentException("Unsupported event object type: " + event.getEventObject().getClass());
            }
        }
    }

    protected abstract EventRegistryProcessingInfo eventReceived(EventInstance eventInstance);

    /**
     * Generates all possible correlation keys for the given correlation parameters.
     * The first element in the list will only have used one parameter. The last element in the list has included all parameters.
     */
    protected Collection<CorrelationKey> generateCorrelationKeys(Collection<EventPayloadInstance> correlationParameterInstances) {

        if (correlationParameterInstances.isEmpty()) {
            return Collections.emptySet();
        }

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Ensure the inbound channel adapter builds an EventInstance (e.g. via InboundEventHandlingStateManager / event payload conversion) and sets it on the event before dispatch.
  2. Inspect the custom adapter/transformer that created the EventRegistryEvent and verify setEventObject/getEventObject is populated.
  3. Add logging at channel reception to confirm the raw payload is non-null and converts correctly.

Example fix

// before
EventRegistryEvent event = new EventRegistryEvent(null);
consumer.eventReceived(event);
// after
EventInstance eventInstance = eventRegistry.createEventInstance("myEventKey", payload);
EventRegistryEvent event = new EventRegistryEvent(eventInstance);
consumer.eventReceived(event);
Defensive patterns

Strategy: type-guard

Validate before calling

if (event == null || event.getEventObject() == null) { log.warn("Skipping event with null payload"); return; }

Type guard

boolean isConsumable(EventRegistryEvent e) { return e != null && e.getEventObject() instanceof EventInstance; }

Try / catch

try { consumer.eventReceived(event); } catch (FlowableIllegalArgumentException e) { log.error("Event payload missing: {}", e.getMessage()); }

Prevention

When it happens

Trigger: A channel adapter or custom producer enqueues an EventRegistryEvent whose event object was never set, or the payload was lost/cleared between reception and consumption.

Common situations: Custom InboundEventChannelAdapter implementations that forget to wrap raw payloads into an EventInstance via EventRegistry.getEventPayloadConverter()/eventInstance building, deserialization returning null, or filtering pipelines dropping the payload.

Related errors


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