{"record":{"id":"c2f42bf248a82c94","repo":"flowable/flowable-engine","slug":"outbound-processor-should-never-call-this","errorCode":null,"errorMessage":"Outbound processor should never call this","messagePattern":"Outbound processor should never call this","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/kafka/KafkaOperationsOutboundEventChannelAdapter.java","lineNumber":85,"sourceCode":"\n            ProducerRecord<Object, Object> producerRecord = new ProducerRecord<>(topic, partition, key, rawEvent, headers);\n            kafkaOperations.send(producerRecord).get();\n            \n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            throw new FlowableException(\"Sending the event was interrupted\", e);\n        } catch (ExecutionException e) {\n            if (e.getCause() instanceof RuntimeException) {\n                throw (RuntimeException) e.getCause();\n            } else {\n                throw new FlowableException(\"failed to send event\", e.getCause());\n            }\n        }\n    }\n\n    @Override\n    public void sendEvent(Object rawEvent, Map<String, Object> headerMap) {\n        throw new UnsupportedOperationException(\"Outbound processor should never call this\");\n    }\n}\n","sourceCodeStart":67,"sourceCodeEnd":88,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/kafka/KafkaOperationsOutboundEventChannelAdapter.java#L67-L88","documentation":"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.","triggerScenarios":"Calling adapter.sendEvent(event, headerMap) directly, or configuring a custom outbound event processor/adapter that invokes the wrong overload.","commonSituations":"Custom FlowableEventRegistryEventProcessor implementations written against the wrong ChannelAdapter interface; test code invoking the adapter manually with a header map.","solutions":["Call the single-argument sendEvent(Object rawEvent) overload instead.","Route headers through the event payload/InboundChannelModel or the channel's header definitions rather than a header map.","Fix the custom processor to implement the correct OutboundEventChannelAdapter interface used by Flowable.","Update test harnesses to invoke the supported method."],"exampleFix":"// before\nadapter.sendEvent(event, headerMap);\n// after\nadapter.sendEvent(event);","handlingStrategy":"type-guard","validationCode":"if (adapter instanceof KafkaOperationsOutboundEventChannelAdapter) {\n    // only call sendEvent(Object); the (Object, Map) overload is unsupported\n}","typeGuard":null,"tryCatchPattern":"try {\n    adapter.sendEvent(event, headerMap);\n} catch (UnsupportedOperationException e) {\n    if (\"Outbound processor should never call this\".equals(e.getMessage())) {\n        adapter.sendEvent(event);\n    } else { throw e; }\n}","preventionTips":["Use the single-argument sendEvent(Object) for outbound Kafka adapters","Route headers via channel header definitions, not a header map","Fix custom processors to invoke the supported ChannelAdapter API"],"tags":["kafka","unsupported-operation","api-misuse"],"backgroundTag":"unsupported-operation","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"}