Kind: Interface
Source: packages/microservices/external/kafka.interface.ts
Part of: Microservices
DeleteAclFilterResponses represents the result of deleting Kafka ACL entries that match a requested filter. It provides the operation status through errorCode and errorMessage, and returns the ACL records that matched the filter in matchingAcls.
Properties
| Property | Type |
|---|---|
errorCode | number |
errorMessage | string |
matchingAcls | MatchingAcl[] |
Diagram
mermaidgraph LR Request[Kafka ACL delete filter] --> Response[DeleteAclFilterResponses] Response --> ErrorCode[errorCode: number] Response --> ErrorMessage[errorMessage: string] Response --> Matches[matchingAcls: MatchingAcl[]] Matches --> Acl1[Matching ACL] Matches --> AclN[Matching ACL]
Usage
tsimport type { DeleteAclFilterResponses } from './kafka.interface';
function handleDeleteAclResponse(response: DeleteAclFilterResponses): void {
if (response.errorCode !== 0) {
throw new Error(
`Unable to delete matching ACLs: ${response.errorMessage}`,
);
}
console.log(`Deleted ${response.matchingAcls.length} matching ACL(s).`);
for (const acl of response.matchingAcls) {
console.log('Deleted ACL:', acl);
}
}
// Example response returned by a Kafka ACL deletion operation
const response: DeleteAclFilterResponses = {
errorCode: 0,
errorMessage: '',
matchingAcls: [],
};
handleDeleteAclResponse(response);
AI Coding Instructions
- Treat
errorCode === 0as the successful operation state; handle non-zero values before consumingmatchingAcls. - Preserve
errorMessagewhen surfacing Kafka ACL deletion failures to logs, callers, or exceptions. - Use
matchingAclsto identify the ACLs affected by the filter, rather than assuming every requested ACL was deleted. - Keep this response type aligned with the Kafka client/admin API response mapping and the
MatchingAclinterface definition.
Was this page helpful?