{"record":{"id":"9bcacbabcdb17f66","repo":"flowable/flowable-engine","slug":"the-kafka-recordkey-value-was-not-found-for-the-ch","errorCode":null,"errorMessage":"The kafka recordKey value was not found for the channel model with key <channelModel.getKey()>. One of fixedValue, delegateExpression or eventField should be set.","messagePattern":"The kafka recordKey value was not found for the channel model with key <channelModel\\.getKey\\(\\)>\\. One of fixedValue, delegateExpression or eventField should be set\\.","errorType":"validation","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/kafka/KafkaChannelDefinitionProcessor.java","lineNumber":720,"sourceCode":"                    \"The kafka partition value was not found for the channel model with key \" + channelModel.getKey()\n                            + \". One of eventField, delegateExpression should be set.\");\n        }\n    }\n\n    protected KafkaMessageKeyProvider<?> resolveKafkaMessageKeyProvider(KafkaOutboundChannelModel channelModel) {\n        KafkaOutboundChannelModel.RecordKey recordKey = channelModel.getRecordKey();\n        if (recordKey == null) {\n            return null;\n        }\n        if (StringUtils.hasText(recordKey.getEventField())) {\n            return new EventPayloadKafkaMessageKeyProvider(recordKey.getEventField());\n        } else if (StringUtils.hasText(recordKey.getDelegateExpression())) {\n            return resolveExpression(recordKey.getDelegateExpression(), KafkaMessageKeyProvider.class);\n        } else if (recordKey.getFixedValue() != null) {\n            String fixedValue = org.apache.commons.lang3.StringUtils.defaultIfBlank(recordKey.getFixedValue(), null);\n            return ignore -> fixedValue;\n        } else {\n            throw new FlowableException(\n                    \"The kafka recordKey value was not found for the channel model with key \" + channelModel.getKey()\n                            + \". One of fixedValue, delegateExpression or eventField should be set.\");\n        }\n    }\n\n    protected <T> T resolveExpression(String expression, Class<T> type) {\n        Object value = this.resolver.evaluate(expression, this.expressionContext);\n        if (type.isInstance(value)) {\n            return type.cast(value);\n        }\n\n        throw new FlowableException(\"expected expression \" + expression + \" to resolve to \" + type + \" but it did not. Resolved value is \" + value);\n\n    }\n\n    protected Object resolveExpression(String value) {\n        String resolvedValue = resolve(value);\n","sourceCodeStart":702,"sourceCodeEnd":738,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/kafka/KafkaChannelDefinitionProcessor.java#L702-L738","documentation":"Thrown when resolving the Kafka record key provider: the recordKey element on the outbound channel model has none of fixedValue, delegateExpression or eventField set, so no key can be produced. Flowable requires at least one key source to build the KafkaMessageKeyProvider.","triggerScenarios":"Registering an outbound Kafka channel whose <recordKey> definition is present but empty, or whose attributes are all blank/null.","commonSituations":"Channel model XML/JSON hand-edited and the recordKey attributes removed; migration from an older event-registry schema where defaults existed.","solutions":["Set eventField on recordKey to point at the event field used as key.","Or set delegateExpression resolving to a KafkaMessageKeyProvider.","Or set fixedValue to a constant key string.","If a null key is actually desired (Kafka round-robin partitioning), remove the recordKey element entirely or configure the model so the resolver is not invoked with an empty recordKey."],"exampleFix":"// before\n\"recordKey\": {}\n// after\n\"recordKey\": { \"fixedValue\": \"order-key\" }","handlingStrategy":"validation","validationCode":"boolean recordKeyConfigured = recordKey != null &&\n    (recordKey.eventField != null || recordKey.delegateExpression != null || recordKey.fixedValue != null);","typeGuard":null,"tryCatchPattern":"try {\n    deployChannel(channelModel);\n} catch (FlowableException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"recordKey value was not found\")) {\n        log.error(\"Channel {} missing recordKey config\", channelModel.getKey(), e);\n    } else { throw e; }\n}","preventionTips":["Set at least one of eventField, delegateExpression or fixedValue whenever a recordKey element exists","Lint channel model files for empty elements before deployment","Test channel deployment in a staging environment"],"tags":["kafka","event-registry","missing-config"],"backgroundTag":"missing-required-config-field","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"}