Interface IKafkaAdminClient
Admin client for managing Kafka topics and cluster configuration.
public interface IKafkaAdminClient : IAsyncDisposable
- Inherited Members
- Extension Methods
Remarks
Provides administrative operations for Kafka topic management including creation, deletion, listing, describing, and configuration updates.
This interface follows the Microsoft pattern of keeping the surface area minimal
(5 methods). It mirrors the Confluent IAdminClient API surface while
using async/await patterns and CancellationToken throughout.
Methods
AlterTopicConfigAsync(string, IReadOnlyDictionary<string, string>, CancellationToken)
Alters configuration entries for the specified topic.
Task AlterTopicConfigAsync(string topicName, IReadOnlyDictionary<string, string> config, CancellationToken cancellationToken)
Parameters
topicNamestringThe name of the topic to alter.
configIReadOnlyDictionary<string, string>The configuration entries to set or update.
cancellationTokenCancellationTokenThe cancellation token.
Returns
Exceptions
- ArgumentNullException
Thrown when
topicNameorconfigis null.
CreateTopicAsync(TopicSpecification, CancellationToken)
Creates a new Kafka topic with the specified configuration.
Task CreateTopicAsync(TopicSpecification specification, CancellationToken cancellationToken)
Parameters
specificationTopicSpecificationThe topic specification including name, partitions, and replication factor.
cancellationTokenCancellationTokenThe cancellation token.
Returns
Exceptions
- ArgumentNullException
Thrown when
specificationis null.
DeleteTopicAsync(string, CancellationToken)
Deletes the specified Kafka topic.
Task DeleteTopicAsync(string topicName, CancellationToken cancellationToken)
Parameters
topicNamestringThe name of the topic to delete.
cancellationTokenCancellationTokenThe cancellation token.
Returns
Exceptions
- ArgumentNullException
Thrown when
topicNameis null.
DescribeTopicAsync(string, CancellationToken)
Describes a Kafka topic including its partitions, replication, and configuration.
Task<TopicDescription> DescribeTopicAsync(string topicName, CancellationToken cancellationToken)
Parameters
topicNamestringThe name of the topic to describe.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<TopicDescription>
A Task<TResult> representing the asynchronous operation, containing the TopicDescription.
Exceptions
- ArgumentNullException
Thrown when
topicNameis null.
ListTopicsAsync(CancellationToken)
Lists all topic names in the Kafka cluster.
Task<IReadOnlyList<string>> ListTopicsAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<IReadOnlyList<string>>
A Task<TResult> representing the asynchronous operation, containing a read-only list of topic names.