Monday, January 7, 2019

Confluent-kafka-dotnet Consumer (client) - sasl configuration example

To use SSL Auth via SASL for Confluent's .NET Client for Apache Kafka,
update the example in the home page help here https://github.com/confluentinc/confluent-kafka-dotnet#basic-consumer-example with below config


var config = new ConsumerConfig

{
    BootstrapServers = brokerList,
    GroupId = groupId,
    EnableAutoCommit = false,
    StatisticsIntervalMs = 5000,
    SessionTimeoutMs = 6000,
    AutoOffsetReset = AutoOffsetResetType.Earliest,
    SecurityProtocol = SecurityProtocolType.Sasl_Ssl,
    SaslMechanism = SaslMechanismType.ScramSha512,
    SaslUsername = "mykafkausername",
    SaslPassword = "mykafkapassword",
    SslCaLocation = "MyKafkaCA.pem" //PEM file location (you may have to copy this to the .bin location
};


Note: 1.0 beta3 has the below changes
AutoOffsetReset = AutoOffsetReset.Earliest,
SecurityProtocol = SecurityProtocol.SaslSsl,
SaslMechanism = SaslMechanism.ScramSha512,

No comments:

Turn on Windows 11 Fast Boot

If windows starting is slow, to enable windows 11 fast startup/boot,  Press Windows + R, type powercfg.cpl, and hit Enter.  This will direct...