Skip to content

[v3]资源订阅接口优化 #8578

@elizabevil

Description

@elizabevil

【消费】watch功能 订阅资源

背景
  • 当前 游标订阅过期 / 同时存在游标与时间参数,接口会直接报错
  • 当前接口报错信息类型较多,不方便实施人员确认,对开发技能要求较高( 更注重 接口使用)
需求
  • 支持游标与时间参数同时存在,且优先级:游标 > 时间

    • 若游标有效 → 按游标继续 watch
    • 若游标无效(过期/找不到) → 自动切换为时间查询
    • 若时间也不合法 → 返回空(或 error code,但必须可识别)
  • 新增drift参数为 当前时间漂移量

    • 参数定义如下

    • 参数名 含义 示例值 类型
      drift 使用当前时间的 ±N 分钟 作为查询范围,避免错过事件 +10m/-10m string
  • 添加错误信息分类

    • 新增level字段支持区分错误等级

    • 分类 举例 期望 错误等级
      系统错误 Mongo 链路异常 提示运维关注 error
      使用者错误 参数格式错误、游标非法 提示业务调用修正 debug
      可恢复错误 游标过期 以warning 类型返回 + 透明恢复 info

注意:接口兼容性,参数为选填,不能影响已有接口调用

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions