Пример #1
0
 public Dictionary <string, object> GetProducerConfig()
 {
     return(new Dictionary <string, object>
     {
         { "acks", (int)Acks.GetValueOrDefault(Configuration.Acks.One) },
         { "bootstrap.servers", string.Join(",", BootstrapServers) },
         { "client.id", ClientId ?? $"{Assembly.GetEntryAssembly().FullName.ToLower()}-{Environment.MachineName.ToLower()}" },
         { "compression.type", CompressionType.GetValueOrDefault(Configuration.CompressionType.None).ToString().ToLower() },
         { "linger.ms", LingerMs.GetValueOrDefault(0) },
         { "request.timeout.ms", RequestTimeoutMs.GetValueOrDefault(30000) },
         { "retries", Retries.GetValueOrDefault(10000000) },
         { "debug", DebugContexts ?? "generic" },
         { "log_level", (int)LogLevel.GetValueOrDefault(Configuration.LogLevel.LOG_INFO) }
     });
 }