public ConsumerGroupHostSettings(string bootstrapServers, string consumerGroupId, ProcessorHostSettings processorHostSettings, AutoResetOffsetPolicy autoResetOffsetPolicy, string clientId = null)
 {
     BootstrapServers      = bootstrapServers;
     ConsumerGroupId       = consumerGroupId;
     ProcessorHostSettings = processorHostSettings;
     ClientId = clientId ?? $"airlock@{Dns.GetHostName()}";
     AutoResetOffsetPolicy = autoResetOffsetPolicy;
 }
예제 #2
0
 public ProcessorHost(string consumerGroupHostId, string routingKey, IAirlockEventProcessor processor, ILog log, Consumer <Null, byte[]> consumer, IMetricScope metricScope, TimeSpan flushMetricsInterval, ProcessorHostSettings processorHostSettings)
 {
     this.routingKey            = routingKey;
     this.processor             = processor;
     this.log                   = log;
     this.consumer              = consumer;
     this.processorHostSettings = processorHostSettings;
     AssignedPartitions         = new int[0];
     processorThread            = new Thread(ProcessorThreadFunc)
     {
         IsBackground = true,
         Name         = $"processor-{consumerGroupHostId}-{processor.ProcessorId}",
     };
     queueGauge             = metricScope.Gauge(flushMetricsInterval, "queue_size", () => eventsQueue.Count);
     pausedGauge            = metricScope.Gauge(flushMetricsInterval, "paused", () => pausedPartitions != null ? 1 : 0);
     messageEnqueuedCounter = metricScope.Counter(flushMetricsInterval, "message_enqueued");
     processorMetrics       = new ProcessorMetrics(metricScope, flushMetricsInterval);
 }