Kind: Interface
Source: packages/microservices/external/kafka.interface.ts
Part of: Microservices
DeleteAclResponse represents the Kafka broker response returned after a delete-ACL request. It includes the broker-applied throttle duration and a result entry for each ACL filter submitted in the request.
Properties
| Property | Type |
|---|---|
throttleTime | number |
filterResponses | DeleteAclFilterResponses[] |
Diagram
mermaidgraph LR Client[Kafka Client] --> Request[Delete ACL Request] Request --> Broker[Kafka Broker] Broker --> Response[DeleteAclResponse] Response --> Throttle[throttleTime: number] Response --> Filters[filterResponses: DeleteAclFilterResponses[]] Filters --> FilterResult[Per-filter deletion results]
Usage
tsimport type { DeleteAclResponse } from './kafka.interface';
function handleDeleteAclResponse(response: DeleteAclResponse): void {
console.log(`Broker throttle time: ${response.throttleTime}ms`);
for (const filterResponse of response.filterResponses) {
console.log('Processed ACL deletion filter:', filterResponse);
}
}
// Example response returned by a Kafka ACL deletion operation
const response: DeleteAclResponse = await kafkaAdmin.deleteAcls({
filters: [
{
resourceType: 2,
resourceName: 'orders',
patternType: 3,
},
],
});
handleDeleteAclResponse(response);
AI Coding Instructions
- Treat
filterResponsesas a per-filter result list; preserve its ordering when correlating results with the original delete-ACL filters. - Use
throttleTimeto respect Kafka broker rate limiting before issuing subsequent administrative requests. - Inspect each
DeleteAclFilterResponsesentry for filter-specific errors rather than assuming the overall request succeeded. - Keep this interface aligned with the Kafka Delete ACLs protocol response schema when upgrading Kafka client or protocol support.
How it works
DeleteAclResponse is an exported TypeScript interface in a file intended to represent KafkaJS package types rather than NestJS logic. packages/microservices/external/kafka.interface.ts:1-8 It describes the resolved value of Admin.deleteAcls, whose argument is an object containing a required filters: AclFilter[] property. packages/microservices/external/kafka.interface.ts:497-500 packages/microservices/external/kafka.interface.ts:502-560
throttleTimeis a requirednumber. packages/microservices/external/kafka.interface.ts:497-499filterResponsesis a required array ofDeleteAclFilterResponses. packages/microservices/external/kafka.interface.ts:497-500- Each filter response contains a required numeric
errorCode, an optionalerrorMessage, and a requiredmatchingAclsarray. packages/microservices/external/kafka.interface.ts:491-495 - Each matching ACL records its resource type, resource name, resource-pattern type, principal, host, operation, permission type, numeric error code, and optional error message. packages/microservices/external/kafka.interface.ts:479-489
The deletion filters require resourceType, resourcePatternType, operation, and permissionType; resourceName, principal, and host are optional. packages/microservices/external/kafka.interface.ts:469-477
This interface contains no runtime implementation, validation, thrown-error declaration, or side-effect logic; it only declares the response shape. packages/microservices/external/kafka.interface.ts:1-8 packages/microservices/external/kafka.interface.ts:497-500
Was this page helpful?