using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace JiShe.CollectBus.Kafka.Consumer { public interface IConsumerService { Task SubscribeAsync(string topic, Func> messageHandler, string? groupId=null) where TKey : notnull where TValue : class; /// /// 订阅消息 /// /// /// /// /// Task SubscribeAsync(string topic, Func> messageHandler, string? groupId = null) where TValue : class; Task SubscribeAsync(string[] topics, Func> messageHandler, string? groupId) where TKey : notnull where TValue : class; /// /// 订阅消息 /// /// /// /// /// /// Task SubscribeAsync(string[] topics, Func> messageHandler, string? groupId = null) where TValue : class; void Unsubscribe() where TKey : notnull where TValue : class; } }