confluent-kafka-dotnet
Show / Hide Table of Contents

Interface IClient

Defines methods common to all client types.

Inherited Members
System.IDisposable.Dispose()
Namespace: Confluent.Kafka
Assembly: cs.temp.dll.dll
Syntax
public interface IClient : IDisposable

Properties

Handle

An opaque reference to the underlying librdkafka client instance. This can be used to construct an AdminClient that utilizes the same underlying librdkafka client as this instance.

Declaration
Handle Handle { get; }
Property Value
Type Description
Handle

Name

Gets the name of this client instance.

Contains (but is not equal to) the client.id configuration parameter.

Declaration
string Name { get; }
Property Value
Type Description
System.String
Remarks

This name will be unique across all client instances in a given application which allows log messages to be associated with the corresponding instance.

Methods

AddBrokers(String)

Adds one or more brokers to the Client's list of initial bootstrap brokers.

Note: Additional brokers are discovered automatically as soon as the Client connects to any broker by querying the broker metadata. Calling this method is only required in some scenarios where the address of all brokers in the cluster changes.

Declaration
int AddBrokers(string brokers)
Parameters
Type Name Description
System.String brokers

Comma-separated list of brokers in the same format as the bootstrap.server configuration parameter.

Returns
Type Description
System.Int32

The number of brokers added. This value includes brokers that may have been specified a second time.

Remarks

There is currently no API to remove existing configured, added or learnt brokers.

In This Article