2025-04-09 14:33:20 +08:00
|
|
|
|
using Confluent.Kafka;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace JiShe.CollectBus.Kafka.Producer
|
|
|
|
|
|
{
|
2025-04-15 11:15:42 +08:00
|
|
|
|
public interface IProducerService
|
2025-04-09 14:33:20 +08:00
|
|
|
|
{
|
2025-04-15 15:49:22 +08:00
|
|
|
|
Task ProduceAsync<TKey, TValue>(string topic, TKey key, TValue value) where TKey : notnull where TValue : class;
|
|
|
|
|
|
|
|
|
|
|
|
Task ProduceAsync<TValue>(string topic, TValue value) where TValue : class;
|
|
|
|
|
|
|
|
|
|
|
|
Task ProduceAsync<TKey, TValue>(string topic, TKey key, TValue value, int? partition, Action<DeliveryReport<TKey, TValue>>? deliveryHandler = null) where TKey : notnull where TValue : class;
|
|
|
|
|
|
|
|
|
|
|
|
Task ProduceAsync<TValue>(string topic, TValue value, int? partition = null, Action<DeliveryReport<Null, TValue>>? deliveryHandler = null) where TValue : class;
|
2025-04-09 14:33:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|