예제 #1
0
        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);
        }
예제 #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);
 }
예제 #3
0
 public abstract void Process(List <AirlockEvent <T> > events, ProcessorMetrics processorMetrics);