Kind: Interface
Source: packages/microservices/external/kafka.interface.ts
Part of: Microservices
DescribeAclResponse represents the response payload returned from a Kafka ACL describe operation. It captures request throttling and error details alongside the ACL resources that matched the query.
Properties
| Property | Type |
|---|---|
throttleTime | number |
errorCode | number |
errorMessage | string |
resources | DescribeAclResource[] |
Diagram
mermaidgraph LR A[Kafka Describe ACL Request] --> B[DescribeAclResponse] B --> C[throttleTime: number] B --> D[errorCode: number] B --> E[errorMessage: string] B --> F[resources: DescribeAclResource[]] F --> G[Matched ACL resources and entries]
Usage
tsimport type { DescribeAclResponse } from './kafka.interface';
function handleDescribeAclResponse(response: DescribeAclResponse): void {
if (response.errorCode !== 0) {
throw new Error(
`Kafka ACL lookup failed (${response.errorCode}): ${response.errorMessage}`,
);
}
console.log(`Request throttled for ${response.throttleTime}ms`);
for (const resource of response.resources) {
console.log('ACL resource:', resource);
}
}
// Example response received from a Kafka client or protocol handler.
const response: DescribeAclResponse = {
throttleTime: 0,
errorCode: 0,
errorMessage: '',
resources: [],
};
handleDescribeAclResponse(response);
AI Coding Instructions
- Check
errorCodebefore consumingresources; a non-zero code indicates the broker could not complete the request. - Preserve
throttleTimefrom the Kafka response so callers can observe or react to broker throttling. - Treat
resourcesas the authoritative list of ACL resources returned by the broker, including an empty array for no matches. - Keep this interface aligned with the Kafka protocol response shape and the related
DescribeAclResourcedefinition.
How it works
DescribeAclResponse is an exported TypeScript interface representing the declared result type of Admin.describeAcls(options), which returns Promise<DescribeAclResponse>. The method accepts an AclFilter; this interface itself declares no runtime logic, validation, thrown errors, or side effects. packages/microservices/external/kafka.interface.ts:462-467 packages/microservices/external/kafka.interface.ts:502-561
It has these required fields:
throttleTime: numberpackages/microservices/external/kafka.interface.ts:462-464errorCode: numberpackages/microservices/external/kafka.interface.ts:462-465resources: DescribeAclResource[]packages/microservices/external/kafka.interface.ts:462-467
It also has an optional errorMessage?: string, so an instance may omit that field. packages/microservices/external/kafka.interface.ts:462-466
Each resources element is a DescribeAclResource: an ACL resource identifier plus an acls array. Its inherited resource fields are:
resourceType: AclResourceTypesresourceName: stringresourcePatternType: ResourcePatternTypes
and it adds acls: Acl[]. packages/microservices/external/kafka.interface.ts:450-460
Each ACL in that array has a string principal, string host, operation: AclOperationTypes, and permissionType: AclPermissionTypes. packages/microservices/external/kafka.interface.ts:443-448 The declared enum domains include resource types such as TOPIC, GROUP, and CLUSTER; operation types such as READ, WRITE, and DESCRIBE; permission types DENY and ALLOW; and resource pattern types including LITERAL and PREFIXED. packages/microservices/external/kafka.interface.ts:285-293 packages/microservices/external/kafka.interface.ts:312-341
Was this page helpful?