import type { MessageEnvelope } from '../../message-contracts/src/message-envelope'; /** 消息处理器只消费项目内信封,禁止业务层依赖具体 RocketMQ SDK 类型。 */ export type MessageHandler = ( message: Readonly>, ) => Promise; /** 消息总线端口隔离客户端选型,并固定发布、订阅和资源关闭的最小语义。 */ export interface MessageBusAdapter { publish(message: Readonly>): Promise; subscribe(eventType: string, handler: MessageHandler): Promise; close(): Promise; }