返回主题:引擎运行时与状态管理

此卡片不在当前主题的阅读序列中,可返回主题继续阅读。

知识卡片

问题卡 · 1980.z.6.c

可组合服务的动作契约

理解等级:中级

相互独立的服务要安全拼成工作流,需要一致的动作与状态协作规则。

可组合服务把动作完整描述成表单:目标URL、方法、媒体类型和输入。任务支持执行、幂等重复与撤销;作业支持从断点继续和从头重跑,后两者不是同一操作。所有任务还共享状态资源。

作业ID关联整次工作,任务ID标识单步,随请求与响应传递;本书correlation-id/request-id命名属于需团队约定的非标准头。撤销未执行任务应是无害操作,以便某任务失败或超时时取消作业并统一撤销各任务;这依赖服务真实实现可重复、可逆承诺,并不等于获得分布式原子回滚。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 超媒体工作流 · 查看原书依据

      The key to designing workflow-compliant services is to offer a consistent set of actions and make it easy to share state data among services. These elements—shared actions and shared state—are at the heart of stable, composable service interfaces. In addition to a shared set of actions and state data, workflow-compliant services support shared identifiers for the job (as correlation-id) and as each task within the workflow job (as request-id).

    参考来源

    - 位置:《RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)》第7章《超媒体工作流》§7.1(来源项目:book-sources;源文件:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch07.xhtml) - 结论依据:原文以可组合服务把动作完整描述成表单:目标URL、方法、媒体类型和输入的方式说明该用途;同节示例与讨论补充了卡内条件和边界。 - 原始内容:The key to designing workflow-compliant services is to offer a consistent set of actions and make it easy to share state data among services. These elements—shared actions and shared state—are at the heart of stable, composable service interfaces. In addition to a shared set of actions and state data, workflow-compliant services support shared identifiers for the job (as correlation-id) and as each task within the workflow job (as request-id).