public KafkaProducerTests() { var services = new ServiceCollection() .AddSingleton <EndpointsConfiguratorsInvoker>() .AddSingleton(typeof(ISilverbackIntegrationLogger <>), typeof(IntegrationLoggerSubstitute <>)); _broker = new KafkaBroker(services.BuildServiceProvider()); }
public KafkaBrokerTests() { var serviceProvider = ServiceProviderHelper.GetServiceProvider( services => services .AddSilverback() .WithConnectionToMessageBroker(options => options.AddKafka())); _broker = serviceProvider.GetRequiredService <KafkaBroker>(); }
private static void Connect() { var messageKeyProvider = new MessageKeyProvider(new[] { new DefaultPropertiesMessageKeyProvider() }); _broker = new KafkaBroker(messageKeyProvider, GetLoggerFactory(), new MessageLogger(messageKeyProvider)); _broker.Connect(); _producer = _broker.GetProducer(new KafkaProducerEndpoint("Topic1") { Configuration = new KafkaProducerConfig { BootstrapServers = "PLAINTEXT://kafka:9092" } }); }