LGouellec / kafka-streams-dotnet

.NET Stream Processing Library for Apache Kafka 🚀
https://lgouellec.github.io/kafka-streams-dotnet/
MIT License
453 stars 73 forks source link

144 refactor internal streamiz configuration #231

Closed LGouellec closed 1 year ago

gitpod-io[bot] commented 1 year ago

LGouellec commented 1 year ago

StreamConfig implementation is totally refactor :

Configuration property is saved :

var streamConfig = new StreamConfig();
streamConfig.ApplicationId = "test";
streamConfig.Acks = Confluent.Kafka.Acks.All;
streamConfig.ApiVersionFallbackMs = 1;
streamConfig.ApiVersionRequest = false;
// etc ...

But you can add configuration dynamically with the AddConfig(...) method, and custom some property for specific Kafka client (main.consumer, producer, restore.consumer and global.consumer)

var streamConfig = new StreamConfig();

streamConfig.AddConfig("application.id", "test-app");
streamConfig.AddConfig("bootstrap.servers", "localhost:9092");
streamConfig.AddConfig("acks", Acks.Leader);
streamConfig.AddConfig("producer.acks", Acks.All);
streamConfig.AddConfig("fetch.max.bytes", 52428800);
streamConfig.AddConfig("restore.consumer.fetch.max.bytes", 52428800*2);
streamConfig.AddConfig("fetch.min.bytes", 2);
streamConfig.AddConfig("main.consumer.fetch.min.bytes", 1000);
streamConfig.AddConfig("fetch.wait.max.ms", 150);
streamConfig.AddConfig("global.consumer.fetch.wait.max.ms", 1000);