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
{
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
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:
Post a Comment