{"record":{"id":"c0e5741e71d08e2f","repo":"apache/rocketmq","slug":"batch-ack-is-empty","errorCode":null,"errorMessage":"batch ack is empty.","messagePattern":"batch ack is empty\\.","errorType":"exception","errorClass":"AuthorizationException","httpStatus":null,"severity":"error","filePath":"auth/src/main/java/org/apache/rocketmq/auth/authorization/builder/DefaultAuthorizationContextBuilder.java","lineNumber":288,"sourceCode":"                case RequestCode.LITE_PULL_MESSAGE:\n                    String pullTopic = requireResource(fields.get(TOPIC), \"topic\");\n                    String pullGroup = requireResource(fields.get(CONSUMER_GROUP), \"consumer group\");\n                    if (NamespaceUtil.isRetryTopic(pullTopic)) {\n                        if (!StringUtils.equals(pullTopic, MixAll.getRetryTopic(pullGroup))) {\n                            throw new AuthorizationException(\"retry topic does not match consumer group.\");\n                        }\n                    } else {\n                        topic = Resource.ofTopic(pullTopic);\n                        result.add(DefaultAuthorizationContext.of(subject, topic, Action.SUB, sourceIp));\n                    }\n                    group = Resource.ofGroup(pullGroup);\n                    result.add(DefaultAuthorizationContext.of(subject, group, Action.SUB, sourceIp));\n                    break;\n                case RequestCode.BATCH_ACK_MESSAGE:\n                    BatchAckMessageRequestBody batchAckBody = decodeRequiredBody(\n                        command, BatchAckMessageRequestBody.class, \"batch ack\");\n                    if (CollectionUtils.isEmpty(batchAckBody.getAcks())) {\n                        throw new AuthorizationException(\"batch ack is empty.\");\n                    }\n                    Set<String> ackResources = new LinkedHashSet<>();\n                    for (BatchAck ack : batchAckBody.getAcks()) {\n                        if (ack == null) {\n                            throw new AuthorizationException(\"batch ack entry is null.\");\n                        }\n                        addUniqueContext(result, ackResources, subject,\n                            Resource.ofTopic(requireResource(ack.getTopic(), \"topic\")),\n                            Action.SUB, sourceIp);\n                        addUniqueContext(result, ackResources, subject,\n                            Resource.ofGroup(requireResource(ack.getConsumerGroup(), \"consumer group\")),\n                            Action.SUB, sourceIp);\n                    }\n                    break;\n                case RequestCode.QUERY_ASSIGNMENT:\n                    QueryAssignmentRequestBody assignmentBody = decodeRequiredBody(\n                        command, QueryAssignmentRequestBody.class, \"query assignment\");\n                    result.add(DefaultAuthorizationContext.of(subject,","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/apache/rocketmq/blob/293f5885719fc4aa3619446a1900f58ccfcfdd29/auth/src/main/java/org/apache/rocketmq/auth/authorization/builder/DefaultAuthorizationContextBuilder.java#L270-L306","documentation":"Error \"batch ack is empty.\" thrown in apache/rocketmq.","triggerScenarios":"Occurs when a batch ack request contains no ack entries.","commonSituations":"Client sends a batch ack with an empty entry list, or the request body failed to decode into entries.","solutions":["Ensure the batch ack request contains at least one ack entry before sending it to the broker.","Check client batch-ack accumulation logic so empty batches are not submitted.","Verify network/serialization issues are not truncating the ack list."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"293f5885719fc4aa3619446a1900f58ccfcfdd29","analyzedAt":"2026-08-14T11:50:13.822Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}