public ConsumerFactory(EventConsumerConfiguration config)
        {
            var consumerConfig = new ConsumerConfig {
                GroupId          = config.GroupId,
                BootstrapServers = config.Server
            };

            consumer = new ConsumerBuilder <Ignore, string> (consumerConfig).Build();
        }
示例#2
0
        EventConsumerConfiguration GetConsumerConfiguration()
        {
            var config = new EventConsumerConfiguration {
                Server  = "kafkaserver",
                GroupId = "groupId",
                Topics  = new List <string> {
                    "NotificationsMicroservices", "NotificationsMicroservices", "OtterNotificationsMicroservices"
                }
            };

            config.RegisterConsumer <ValidEvent, ValidEventHandler> ();
            config.Handlers[Utils.INVALID_EVENT_NAME] = typeof(InvalidEventHandler);

            return(config);
        }
示例#3
0
 public DummyConsumer(IConsumerFactory consumerFactory, EventConsumerConfiguration options, IServiceProvider serviceProvider, ILogger <Consumer> logger)
     : base(consumerFactory, options, serviceProvider, logger)
 {
 }