public void CreateProducerClient() { var supplier = new DefaultKafkaClientSupplier(new KafkaLoggerAdapter(config)); var produce = supplier.GetProducer(config.ToProducerConfig("produce")); Assert.IsNotNull(produce); Assert.AreEqual("produce", produce.Name.Split("#")[0]); }
public void CreateRestoreClient() { var supplier = new DefaultKafkaClientSupplier(new KafkaLoggerAdapter(config)); var restore = supplier.GetRestoreConsumer(config.ToConsumerConfig("retore")); Assert.IsNotNull(restore); Assert.AreEqual("retore", restore.Name.Split("#")[0]); }
public void CreateConsumerClient() { var supplier = new DefaultKafkaClientSupplier(new KafkaLoggerAdapter(config)); var consumer = supplier.GetConsumer(config.ToConsumerConfig("consume"), new StreamsRebalanceListener(null)); Assert.IsNotNull(consumer); Assert.AreEqual("consume", consumer.Name.Split("#")[0]); }
public void CreateAdminClient() { var supplier = new DefaultKafkaClientSupplier(new KafkaLoggerAdapter(config)); var adminClient = supplier.GetAdmin(config.ToAdminConfig("admin")); Assert.IsNotNull(adminClient); Assert.AreEqual("admin", adminClient.Name.Split("#")[0]); }
public void CreateConsumerWithStats() { config.ExposeLibrdKafkaStats = true; config.ApplicationId = "test-app"; config.ClientId = "test-client"; var supplier = new DefaultKafkaClientSupplier(new KafkaLoggerAdapter(config), config); supplier.MetricsRegistry = new StreamMetricsRegistry(); var consumerConfig = config.ToConsumerConfig("consume"); StreamizConsumerConfig wrapper = new StreamizConsumerConfig(consumerConfig, "thread-1"); var consumer = supplier.GetConsumer(wrapper, new StreamsRebalanceListener(null)); Assert.IsNotNull(consumer); }
public void CreateProducerWithStats() { config.ExposeLibrdKafkaStats = true; config.ApplicationId = "test-app"; config.ClientId = "test-client"; var supplier = new DefaultKafkaClientSupplier(new KafkaLoggerAdapter(config), config); supplier.MetricsRegistry = new StreamMetricsRegistry(); var producerConfig = config.ToProducerConfig("producer"); StreamizProducerConfig wrapper = new StreamizProducerConfig(producerConfig, "thread-1", new TaskId() { Id = 0, Partition = 0 }); var producer = supplier.GetProducer(wrapper); Assert.IsNotNull(producer); }