confluent-kafka-dotnet
Show / Hide Table of Contents

Class Config

Base functionality common to all configuration classes.

Inheritance
System.Object
Config
ClientConfig
Implements
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>>
System.Collections.IEnumerable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Confluent.Kafka
Assembly: cs.temp.dll.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
System.Collections.Generic.IDictionary<System.String, System.String> config

Fields

properties

The configuration properties.

Declaration
protected IDictionary<string, string> properties
Field Value
Type Description
System.Collections.Generic.IDictionary<System.String, System.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
System.Int32

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
System.String key

The configuration property to get.

Returns
Type Description
System.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
System.String key

The configuration property to get.

Returns
Type Description
System.Nullable<System.Boolean>

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
System.String key

The configuration property to get.

Returns
Type Description
System.Nullable<System.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
System.Type type

The enum type of the configuration property.

System.String key

The configuration property to get.

Returns
Type Description
System.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
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.String, System.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
System.String key

The configuration property to get.

Returns
Type Description
System.Nullable<System.Int32>

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
System.String key

The configuration property name.

System.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
System.String name
System.Object val

Implements

System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable