public void Process(List <AirlockEvent <byte[]> > events, ProcessorMetrics processorMetrics) { var airlockEvents = events.Select(x => new AirlockEvent <T> { RoutingKey = x.RoutingKey, Timestamp = x.Timestamp, Payload = airlockDeserializer.Deserialize(new ByteBufferAirlockSource(x.Payload)), }).ToList(); airlockEventProcessor.Process(airlockEvents, processorMetrics); }
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); }
public abstract void Process(List <AirlockEvent <T> > events, ProcessorMetrics processorMetrics);