AWS_MSK_IAM setting for .NET client

How to specify the connectivity settings to Apache Kafka configured in AWS using AWS_MSK_IAM, now as per our evaulation, it is only available for Java clients but not for .NET client

Java Sample:-

configProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,“testurl.kafka.eu-west-1.amazonaws.com:6995”);
configProps.put(SaslConfigs.SASL_CLIENT_CALLBACK_HANDLER_CLASS, “software.amazon.msk.auth.iam.IAMClientCallbackHandler”);
configProps.put(SaslConfigs.SASL_MECHANISM, “AWS_MSK_IAM”);
configProps.put(“security.protocol”, “SASL_SSL”);
configProps.put(SaslConfigs.SASL_JAAS_CONFIG, “software.amazon.msk.auth.iam.IAMLoginModule required awsRoleArn="arn:aws:iam::xxxx:role/testurl" awsRoleSessionName="producer" awsStsRegion="eu-west-1" awsDebugCreds=true;”);
configProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,StringSerializer.class);
configProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, CloudEventSerializer.class);
configProps.put(ProducerConfig.INTERCEPTOR_CLASSES_CONFIG,“io.cloudevents.kafka.PartitionKeyExtensionInterceptor”

How to specify below properties using .NET confluent library in order to use AWS_MSK_IAM mechanism?

SaslConfigs.SASL_MECHANISM= AWS_MSK_IAM
SaslConfigs.SASL_JAAS_CONFIG
SaslConfigs.SASL_CLIENT_CALLBACK_HANDLER_CLASS
ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG
ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG
ProducerConfig.INTERCEPTOR_CLASSES_CONFIG

regards
AG

I’d suggest reading the librdkafka documentation for config options since that’s what the dotnet client uses, rather than compare to JVM options, which don’t.

This may require you to define your own C# SASL class, yes