using MicoService.Demo.DTOs; namespace MicoService.Demo.Services { /// /// ============================================================ /// Point-to-Point 通信模式示例 - 发送服务 /// ============================================================ /// /// 服务特点: /// /// 1. 使用 IBus.Send() 发送单向消息 /// - 不等待响应,消息发送后立即返回 /// - 提高性能,减少等待时间 /// /// 2. 与 Request-Response 的区别 /// - Request-Response: 使用 IRequestClient.GetResponse(),等待响应 /// - Point-to-Point: 使用 IBus.Send(),不等待响应 /// /// 3. 使用场景 /// - 订单创建后异步通知库存服务 /// - 不需要立即知道处理结果的场景 /// - 对性能要求较高的场景 /// /// 4. 消息可靠性 /// - 消息持久化保证消息不丢失 /// - 死信队列处理失败的消息 /// - 重试机制处理临时性错误 /// /// ============================================================ public interface IOrderInventoryNotificationService { /// /// 发送订单创建通知(不等待响应) /// /// 订单ID /// 用户ID /// 订单项列表 /// 异步任务 Task SendOrderCreatedNotificationAsync(string orderId, string userId, List items); /// /// 发送订单取消通知(不等待响应) /// /// 订单ID /// 用户ID /// 订单项列表 /// 异步任务 Task SendOrderCancelledNotificationAsync(string orderId, string userId, List items); } }