Table of Contents

Interface IKafkaAdminClient

Namespace
Excalibur.Dispatch.Transport.Kafka
Assembly
Excalibur.Dispatch.Transport.Kafka.dll

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

topicName string

The name of the topic to alter.

config IReadOnlyDictionary<string, string>

The configuration entries to set or update.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A Task representing the asynchronous alter operation.

Exceptions

ArgumentNullException

Thrown when topicName or config is null.

CreateTopicAsync(TopicSpecification, CancellationToken)

Creates a new Kafka topic with the specified configuration.

Task CreateTopicAsync(TopicSpecification specification, CancellationToken cancellationToken)

Parameters

specification TopicSpecification

The topic specification including name, partitions, and replication factor.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A Task representing the asynchronous create operation.

Exceptions

ArgumentNullException

Thrown when specification is null.

DeleteTopicAsync(string, CancellationToken)

Deletes the specified Kafka topic.

Task DeleteTopicAsync(string topicName, CancellationToken cancellationToken)

Parameters

topicName string

The name of the topic to delete.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A Task representing the asynchronous delete operation.

Exceptions

ArgumentNullException

Thrown when topicName is null.

DescribeTopicAsync(string, CancellationToken)

Describes a Kafka topic including its partitions, replication, and configuration.

Task<TopicDescription> DescribeTopicAsync(string topicName, CancellationToken cancellationToken)

Parameters

topicName string

The name of the topic to describe.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TopicDescription>

A Task<TResult> representing the asynchronous operation, containing the TopicDescription.

Exceptions

ArgumentNullException

Thrown when topicName is null.

ListTopicsAsync(CancellationToken)

Lists all topic names in the Kafka cluster.

Task<IReadOnlyList<string>> ListTopicsAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IReadOnlyList<string>>

A Task<TResult> representing the asynchronous operation, containing a read-only list of topic names.