Closed progrocket closed 1 year ago
Hi @progrocket,
Thanks for your issue. Indeed, you can't set the bootstrap servers directly with the dictionary property, because the StreamConfig.BootstrapServers
property set directly into ConsumerConfig / ProducerConfig / AdminConfig
For your information, I will refactor the configuration for the next release (eg 1.5.0
). This issue #144 track this feature.
Workaround :
var configuration = new Dictionary<string, dynamic> {
["application.id"] = "Test",
};
var streamConfig = new StreamConfig(configuration) {
AutoOffsetReset = Confluent.Kafka.AutoOffsetReset.Earliest,
BootstrapServers = "localhost:9092"
};
This issue will fix soon with the new StreamConfig
implementation.
See #144
Now, this implementation works :
Func<ProcessorContext, ConsumeResult<byte[], byte[]>, Exception, ExceptionHandlerResponse> f = (_, _, _) =>
ExceptionHandlerResponse.CONTINUE;
var configuration = new Dictionary<string, dynamic>
{
["application.id"] = "test-app",
["deserialization.exception.handler"] = f,
["metrics.interval.ms"] = 100000,
["follow.metadata"] = true,
["bootstrap.servers"] = "localhost:9092"
};
var streamConfig = new StreamConfig(configuration);
Fixed with PR #231
First, thank you very much for your library.
Description
When configuring
StreamConfig
via the constructor with the dictionary, an exception occurs when creating aKafkaStream
An exception occurs when passing the "ApplicationId" and "BootstrapServers" keys to the dictionary constructor:If you change the keys, replacing "ApplicationId" with "application.id" and "BootstrapServers" with "bootstrap.servers", you get another exception:
How to reproduce
All the code is here: https://github.com/progrocket/streamiz-configuration-bug
Package Version:
1.4.2