{"record":{"id":"2e5a62b038fa0c01","repo":"flowable/flowable-engine","slug":"jsonpointer-expression-did-not-detect-event-key","errorCode":null,"errorMessage":"JsonPointer expression {} did not detect event key","messagePattern":"JsonPointer expression (.+?) did not detect event key","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/keydetector/JsonPointerBasedInboundEventKeyDetector.java","lineNumber":47,"sourceCode":"    private static final Logger LOGGER = LoggerFactory.getLogger(JsonPointerBasedInboundEventKeyDetector.class);\n\n    protected ObjectMapper objectMapper;\n\n    protected String jsonPointerValue;\n    protected JsonPointer jsonPointerExpression;\n\n    public JsonPointerBasedInboundEventKeyDetector(String jsonPointerExpression, ObjectMapper objectMapper) {\n        this.jsonPointerValue = jsonPointerExpression;\n        this.jsonPointerExpression = JsonPointer.compile(jsonPointerExpression);\n        this.objectMapper = objectMapper;\n    }\n\n    @Override\n    public String detectEventDefinitionKey(JsonNode payload) {\n        JsonNode result = payload.at(jsonPointerExpression);\n\n        if (result == null || result.isMissingNode() || result.isNull()) {\n            LOGGER.warn(\"JsonPointer expression {} did not detect event key\", jsonPointerExpression);\n            return null;\n        }\n\n        if (result.isString()) {\n            return result.asString();\n        }\n\n        return null;\n    }\n    \n    public String getJsonPointerValue() {\n        return jsonPointerValue;\n    }\n}\n","sourceCodeStart":29,"sourceCodeEnd":62,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/keydetector/JsonPointerBasedInboundEventKeyDetector.java#L29-L62","documentation":"This is a WARN log emitted by JsonPointerBasedInboundEventKeyDetector when a JSON Pointer expression applied to the inbound event payload resolves to null, a missing node, or a JSON null. The detector returns null, meaning no event definition key could be extracted from the payload. It is not thrown; it signals the configured jsonPointerExpression did not match any value in the payload.","triggerScenarios":"Inbound event registry channel invokes detectEventDefinitionKey(payload); the configured jsonPointerExpression (e.g. /order/type) points at a property that is absent, null, or misspelled in the incoming JSON, or the payload shape differs from what the expression was authored against.","commonSituations":"Typo in the JSON Pointer expression in the event model definition; producer changed/renamed the payload field; nested arrays/paths where at() returns missing nodes; payload sent without the key element entirely; version drift between event schema versions.","solutions":["Verify the payload actually contains the field the pointer targets (log the raw payload at DEBUG)","Fix the jsonPointerExpression in the event definition so it matches the real payload path (e.g. /data/type instead of /type)","Ensure the producer includes the key element in every event","Handle a null return from detectEventDefinitionKey by routing to a default/no-key event definition"],"exampleFix":"// before (event definition JSON)\n\"keyDetection\": { \"jsonPointerExpression\": \"/order/type\" }\n// after (payload is { \"data\": { \"order\": { \"type\": \"NEW\" } } })\n\"keyDetection\": { \"jsonPointerExpression\": \"/data/order/type\" }","handlingStrategy":"validation","validationCode":"// before registering key detection, probe the pointer against a sample payload\nJsonNode sample = new ObjectMapper().readTree(sampleJson);\nJsonNode hit = sample.at(\"/data/order/type\");\nif (hit.isMissingNode() || hit.isNull()) {\n    throw new IllegalArgumentException(\"jsonPointerExpression does not match sample payload\");\n}","typeGuard":"static boolean hasKey(JsonNode payload, String pointer) {\n    JsonNode n = payload.at(pointer);\n    return n != null && !n.isMissingNode() && !n.isNull();\n}","tryCatchPattern":null,"preventionTips":["Validate the JSON Pointer expression against a sample producer payload during event model authoring","Add contract/schema tests between producer payload shape and event definitions","Keep key fields mandatory in the producer's serialization","Version event definitions together with payload schema changes"],"tags":["json-pointer","event-registry","payload-mapping"],"backgroundTag":"unexpected-response-shape","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"}