Apache Kafka transport for the NetEvolve.Pulse outbox processor.
Delivers outbox messages directly to Kafka topics using the Confluent.Kafka producer.
Register the Confluent.Kafka producer and admin client in DI, then call UseKafkaTransport():
// 1. Register the Confluent.Kafka producer (user's responsibility)
services.AddSingleton<IProducer<string, string>>(sp =>
new ProducerBuilder<string, string>(
new ProducerConfig { BootstrapServers = "localhost:9092", Acks = Acks.All })
.Build());
// 2. Register the admin client (used for health checks)
services.AddSingleton<IAdminClient>(sp =>
new AdminClientBuilder(
new AdminClientConfig { BootstrapServers = "localhost:9092" })
.Build());
// 3. Register the Pulse Kafka transport
services.AddPulse(config => config.AddOutbox().UseKafkaTransport());Topic names are resolved by the registered ITopicNameResolver. The default implementation
(registered by AddOutbox()) extracts the simple class name from OutboxMessage.EventType,
e.g. "MyApp.Events.OrderCreated, MyApp" → "OrderCreated".
Register a custom ITopicNameResolver before calling UseKafkaTransport() to override:
services.AddSingleton<ITopicNameResolver, MyCustomTopicNameResolver>();
services.AddPulse(config => config.AddOutbox().UseKafkaTransport());IProducer<string, string>andIAdminClientmust be registered by the caller.IsHealthyAsyncqueries cluster metadata; returnsfalsewhen the broker is unreachable.