public AlertConsumer(IOptions <KafkaOpts> kafkaOptions, IAlertStream alertStream) { _kafkaConfig = new ConsumerConfig { GroupId = kafkaOptions.Value.GroupId, BootstrapServers = kafkaOptions.Value.Host, AutoOffsetReset = AutoOffsetReset.Earliest }; _kafkaTopics = kafkaOptions.Value.Topic.Split(",").ToList(); _alertStream = alertStream; }
public AlertRelay(IHubContext <AlertHub> hubContext, IAlertStream alertStream) { alertStream.Subscribe("alert_relay", async(alert) => await hubContext.Clients.All.SendAsync("alerts", alert.Message)); }