confluent-kafka-dotnet
Show / Hide Table of Contents

Class Config

Base functionality common to all configuration classes.

Inheritance
object
Config
ClientConfig
SerdeConfig
Implements
IEnumerable<KeyValuePair<string, string>>
IEnumerable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Confluent.Kafka
Assembly: Confluent.Kafka.dll
Syntax
public class Config : IEnumerable<KeyValuePair<string, string>>, IEnumerable

Constructors

Config()

Initialize a new empty Config instance.

Declaration
public Config()

Config(Config)

Initialize a new Config instance based on an existing Config instance. This will change the values "in-place" i.e. operations on this class WILL modify the provided collection

Declaration
public Config(Config config)
Parameters
Type Name Description
Config config

Config(IDictionary<string, string>)

Initialize a new Config wrapping an existing key/value dictionary. This will change the values "in-place" i.e. operations on this class WILL modify the provided collection

Declaration
public Config(IDictionary<string, string> config)
Parameters
Type Name Description
IDictionary<string, string> config

Fields

properties

The configuration properties.

Declaration
protected IDictionary<string, string> properties
Field Value
Type Description
IDictionary<string, string>

Properties

CancellationDelayMaxMs

The maximum length of time (in milliseconds) before a cancellation request is acted on. Low values may result in measurably higher CPU usage.

default: 100 range: 1 <= dotnet.cancellation.delay.max.ms <= 10000 importance: low

Declaration
public int CancellationDelayMaxMs { set; }
Property Value
Type Description
int

Methods

Get(string)

Gets a configuration property value given a key. Returns null if the property has not been set.

Declaration
public string Get(string key)
Parameters
Type Name Description
string key

The configuration property to get.

Returns
Type Description
string

The configuration property value.

GetBool(string)

Gets a configuration property bool? value given a key.

Declaration
protected bool? GetBool(string key)
Parameters
Type Name Description
string key

The configuration property to get.

Returns
Type Description
bool?

The configuration property value.

GetDouble(string)

Gets a configuration property double? value given a key.

Declaration
protected double? GetDouble(string key)
Parameters
Type Name Description
string key

The configuration property to get.

Returns
Type Description
double?

The configuration property value.

GetEnum(Type, string)

Gets a configuration property enum value given a key.

Declaration
protected object GetEnum(Type type, string key)
Parameters
Type Name Description
Type type

The enum type of the configuration property.

string key

The configuration property to get.

Returns
Type Description
object

The configuration property value.

GetEnumerator()

Returns an enumerator that iterates through the property collection.

Declaration
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
Returns
Type Description
IEnumerator<KeyValuePair<string, string>>

An enumerator that iterates through the property collection.

GetInt(string)

Gets a configuration property int? value given a key.

Declaration
protected int? GetInt(string key)
Parameters
Type Name Description
string key

The configuration property to get.

Returns
Type Description
int?

The configuration property value.

Set(string, string)

Set a configuration property using a string key / value pair.

Declaration
public void Set(string key, string val)
Parameters
Type Name Description
string key

The configuration property name.

string val

The property value.

Remarks

Two scenarios where this is useful: 1. For setting librdkafka plugin config properties. 2. You are using a different version of librdkafka to the one provided as a dependency of the Confluent.Kafka package and the configuration properties have evolved.

SetObject(string, object)

Set a configuration property using a key / value pair (null checked).

Declaration
protected void SetObject(string name, object val)
Parameters
Type Name Description
string name
object val

Implements

IEnumerable<T>
IEnumerable
In this article