using Confluent.Kafka; namespace JiShe.CollectBus.Kafka.Producer { public interface IProducerService { Task ProduceAsync(string topic, TKey key, TValue value) where TKey : notnull where TValue : class; Task ProduceAsync(string topic, TValue value) where TValue : class; Task ProduceAsync(string topic, TKey key, TValue value, int? partition, Action>? deliveryHandler = null) where TKey : notnull where TValue : class; Task ProduceAsync(string topic, TValue value, int? partition = null, Action>? deliveryHandler = null) where TValue : class; } }