{"id":"e1dc4c663a545ef5","repo":"apache/kafka","slug":"unknown-acknowledge-type-id-id","errorCode":null,"errorMessage":"Unknown acknowledge type id: {id}","messagePattern":"Unknown acknowledge type id: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"clients/src/main/java/org/apache/kafka/clients/consumer/AcknowledgeType.java","lineNumber":72,"sourceCode":"    /**\n     * Returns the AcknowledgeType for the given identifier.\n     *\n     * @param id The identifier for the acknowledge type\n     * @return The corresponding AcknowledgeType\n     * @throws IllegalArgumentException If the ID is not recognized\n     */\n    public static AcknowledgeType forId(byte id) {\n        switch (id) {\n            case 1:\n                return ACCEPT;\n            case 2:\n                return RELEASE;\n            case 3:\n                return REJECT;\n            case 4:\n                return RENEW;\n            default:\n                throw new IllegalArgumentException(\"Unknown acknowledge type id: \" + id);\n        }\n    }\n}\n","sourceCodeStart":54,"sourceCodeEnd":76,"githubUrl":"https://github.com/apache/kafka/blob/c31c9215e131f8c17e79f8901b48c13ee6aa8e7a/clients/src/main/java/org/apache/kafka/clients/consumer/AcknowledgeType.java#L54-L76","documentation":"Thrown by AcknowledgeType.forId(byte) when deserializing an acknowledge-type byte that is not 1 (ACCEPT), 2 (RELEASE), 3 (REJECT), or 4 (RENEW). AcknowledgeType is used by KafkaShareConsumer.acknowledge to signal acquisition-lock/disposition state on a share-group record. An unknown id means the broker returned or forwarded a value the client cannot map to a known disposition.","triggerScenarios":"Calling KafkaShareConsumer.acknowledge(...) where the broker responds with an acknowledge id outside 1-4, or deserializing an AcknowledgementsResponse / ShareFetch response whose commit/acknowledge byte is unrecognized. Reachable only on the share-groups code path (KIP-932).","commonSituations":"Client/broker version skew where the broker added a new AcknowledgeType the client does not know; an intermediate proxy or a custom serializer mangling the acknowledge byte; using an old kafka-clients version against a broker that has the share-groups feature enabled with extended ack semantics.","solutions":["Upgrade kafka-clients to a version that supports the same share-group acknowledge semantics as the broker.","Ensure no proxy/interceptor is rewriting share-group response payloads.","Confirm the broker version actually supports KafkaShareConsumer and that share-group topics are not being routed through a classic consumer."],"exampleFix":"// before: kafka-clients 3.8 (no share ack types) against broker 3.9+\n// KafkaShareConsumer.acknowledge throws via forId on unknown id\n\n// after\n<dependency>\n  <groupId>org.apache.kafka</groupId>\n  <artifactId>kafka-clients</artifactId>\n  <version>3.9.0</version>\n</dependency>","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"// If you must map a raw byte back to AcknowledgeType, narrow it first:\nstatic Optional<AcknowledgeType> safeAcknowledgeType(byte id) {\n    return Arrays.stream(AcknowledgeType.values()).filter(t -> t.id == id).findFirst();\n}","tryCatchPattern":"// AcknowledgeType.forId is normally only invoked by internal wire decoding. Application code uses the enum directly.\ntry {\n    AcknowledgeType t = AcknowledgeType.forId(rawByte);\n} catch (IllegalArgumentException e) {\n    log.warn(\"Ignoring unknown acknowledge type id {} (client/broker version skew)\", rawByte);\n    // default to ACCEPT or surface a processing error to the caller\n}","preventionTips":["Application code should pass the AcknowledgeType enum (ACCEPT/RELEASE/REJECT/RENEW) to KafkaShareConsumer.acknowledge, never a raw byte.","This error signals client/broker version mismatch when decoding a share-ack from the wire.","Upgrade the client jar to match the broker when new acknowledge types appear."],"tags":["share-consumer","share-groups","wire-protocol","version-mismatch","deserialization","java"],"analyzedSha":"c31c9215e131f8c17e79f8901b48c13ee6aa8e7a","analyzedAt":"2026-08-03T12:34:05.770Z","schemaVersion":2}