namespace WIDESEAWCS_RedisService.Stream { public interface IStreamProcessingService { /// /// 发送消息到Stream /// string AddMessage(string streamKey, Dictionary fields); /// /// 创建消费者组 /// bool CreateConsumerGroup(string streamKey, string groupName, string startId = "$"); /// /// 读取消息(消费者组模式) /// List ReadGroup(string streamKey, string groupName, string consumerName, int count = 10); /// /// 确认消息 /// long Acknowledge(string streamKey, string groupName, params string[] messageIds); /// /// 获取Stream长度 /// long GetStreamLength(string streamKey); /// /// 裁剪Stream /// long TrimStream(string streamKey, int maxLength); } public class StreamEntry { public string Id { get; set; } = string.Empty; public Dictionary Fields { get; set; } = new(); } }