public KafkaStreamProviderOptions(IProviderConfiguration config)
{
if (config == null) throw new ArgumentNullException(nameof(config));
string rawConnectionStrings = GetRequiredParam(ConnectionStringsParam, config);
// Parsing the connection strings
var dividedConnectionStrings = rawConnectionStrings.Split(ConnectionStringDelimiter);
// Setting the required params
_connectionStrings = dividedConnectionStrings.Select(dividedConnectionString => new Uri(dividedConnectionString)).ToList();
_topicName = GetRequiredParam(TopicNameParam, config);
_consumerGroupName = GetRequiredParam(ConsumerGroupNameParam, config);
// Setting the optional params
CacheSize = GetOptionalParamInt(CacheSizeParam, DefaultCacheSize, config);
NumOfQueues = GetOptionalParamInt(NumOfQueuesParam, DefaultNumOfQueues, config);
AckLevel = GetOptionalParamInt(AckLevelParam, DefaultAckLevel, config);
MaxBytesInMessageSet = GetOptionalParamInt(MaxBytesInMessageSetParam, DefaultMaxBytesInMessageSet, config);
OffsetCommitInterval = GetOptionalParamInt(OffsetCommitIntervalParam, DefaultOffsetCommitInterval, config);
ProduceBatchSize = GetOptionalParamInt(ProduceBatchSizeParam, DefaultProduceBatchSize, config);
TimeToWaitForBatchInMs = GetOptionalParamInt(TimeToWaitForBatchInMsParam, DefaultTimeToWaitForBatchInMs, config);
ReceiveWaitTimeInMs = GetOptionalParamInt(ReceiveWaitTimeInMsParam, DefaultReceiveWaitTimeInMs, config);
ShouldInitWithLastOffset = GetOptionalParamBool(ShouldInitWithLastOffsetParam, DefaultShouldInitWithLastOffset, config);
MaxMessageSizeInBytes = GetOptionalParamInt(MaxMessageSizeInBytesParam, DefaultMaxBytesInMessageSet,
config);
CacheTimespanInSeconds = GetOptionalParamInt(CacheTimespanInSecondsParam, DefaultCacheTimespanInSeconds,
config);
CacheNumOfBuckets = GetOptionalParamInt(CacheNumOfBucketsParam, DefaultCacheNumOfBucketsParam, config);
MetricsPort = GetOptionalParamInt(MetricsPortParam, DefaultMetricsPort, config);
IncludeMetrics = GetOptionalParamBool(IncludeMetricsParam, DefaultIncludeMetrics, config);
UsingExternalMetrics = GetOptionalParamBool(UsingExternalMetricsParam, DefaultUsingExternalMetrics, config);
}