confluent-kafka-dotnet icon indicating copy to clipboard operation
confluent-kafka-dotnet copied to clipboard

Add interfaces to `ProducerBuilder` and `ConsumerBuilder`

Open deeja opened this issue 2 years ago • 1 comments

Neither ConsumerBuilder or ProducerBuilder currently have an interface attached. When testing code that relates to the configuration of a consumer, it's difficult without reflection to check whether configs or handlers have been set.

In my code I've used an adapter to add an interface. An example of where this would be helpful is here: https://github.com/deeja/KafkaConsumerRetry/blob/main/KafkaConsumerRetry.Tests/Factories/LocalConsumerBuilderTests/BuildConsumerShould.cs#L18-L31

An example of this the change is here: https://github.com/confluentinc/confluent-kafka-dotnet/compare/master...deeja:confluent-kafka-dotnet:consumer_builder_interface

deeja avatar Jan 06 '23 05:01 deeja