flowable/flowable-engine · error · UnsupportedOperationException

Outbound processor should never call this

Error message

Outbound processor should never call this

What it means

The two-argument sendEvent(Object, Map) on KafkaOperationsOutboundEventChannelAdapter is an unsupported legacy/alternate entry point: outbound event processors must use sendEvent(Object) (which builds headers internally), so calling the header-map overload always throws UnsupportedOperationException. This is a programming-contract violation, not a runtime condition.

Solutions

  1. Call the single-argument sendEvent(Object rawEvent) overload instead.
  2. Route headers through the event payload/InboundChannelModel or the channel's header definitions rather than a header map.
  3. Fix the custom processor to implement the correct OutboundEventChannelAdapter interface used by Flowable.
  4. Update test harnesses to invoke the supported method.

Example fix

// before
adapter.sendEvent(event, headerMap);
// after
adapter.sendEvent(event);
Defensive patterns

Strategy: type-guard

Validate before calling

if (adapter instanceof KafkaOperationsOutboundEventChannelAdapter) {
    // only call sendEvent(Object); the (Object, Map) overload is unsupported
}

Try / catch

try {
    adapter.sendEvent(event, headerMap);
} catch (UnsupportedOperationException e) {
    if ("Outbound processor should never call this".equals(e.getMessage())) {
        adapter.sendEvent(event);
    } else { throw e; }
}

Prevention

When it happens

Trigger: Calling adapter.sendEvent(event, headerMap) directly, or configuring a custom outbound event processor/adapter that invokes the wrong overload.

Common situations: Custom FlowableEventRegistryEventProcessor implementations written against the wrong ChannelAdapter interface; test code invoking the adapter manually with a header map.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/kafka/KafkaOperationsOutboundEventChannelAdapter.java:85

            ProducerRecord<Object, Object> producerRecord = new ProducerRecord<>(topic, partition, key, rawEvent, headers);
            kafkaOperations.send(producerRecord).get();
            
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new FlowableException("Sending the event was interrupted", e);
        } catch (ExecutionException e) {
            if (e.getCause() instanceof RuntimeException) {
                throw (RuntimeException) e.getCause();
            } else {
                throw new FlowableException("failed to send event", e.getCause());
            }
        }
    }

    @Override
    public void sendEvent(Object rawEvent, Map<String, Object> headerMap) {
        throw new UnsupportedOperationException("Outbound processor should never call this");
    }
}

View on GitHub (pinned to d6d39ce1c6)