← 返回刚才阅读的位置

知识卡片

支付系统案例卡 · 2277.o.3.c

涨价批处理重放风险

理解等级:中级

商品目录用updatePercent=.05逐项涨价,处理中途故障会留下部分已更新、部分未更新的状态;若成功后响应丢失,客户端同样不知道已完成多少。重新执行整个百分比更新,会让已处理商品再次涨价。即使请求使用PUT,业务消息仍是增量操作,方法名不能弥补这个重复作用风险。

对应方案见[[替换值使批处理可重放]]。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 超媒体接口设计 · 查看原书依据

      In this example, when the PUT request is received, the value of updatePercent is used to update each of the 55 products in the company catalog. But what happens if the update fails halfway through the list of products? Some products were updated, some were not. Or what if we never get a response message for the request? Was is successfully applied? To all products? It is safe to rerun this action?

    参考来源

    - 位置:《RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)》第03章《超媒体接口设计》(来源项目 book-sources;源文件:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch03.xhtml;小节:3.8) - 结论依据:原文以商品目录用updatePercent=.05逐项涨价,处理中途故障会留下部分已更新、部分未更新的状态;若成功后响应丢失,客户端同样不知道已完成多少的机制或场景为依据;同小节余文补充本卡所列条件,按2022年原书语境整理。 - 原始内容:In this example, when the PUT request is received, the value of updatePercent is used to update each of the 55 products in the company catalog. But what happens if the update fails halfway through the list of products? Some products were updated, some were not. Or what if we never get a response message for the request? Was is successfully applied? To all products? It is safe to rerun this action?