【发布时间】:2022-11-29 00:40:03
【问题描述】:
我是一个客户,比如 clientA,我需要每 15 分钟定期调用服务器 serverA,以便从 serverA 获取新的更新。
ServerA 只能公开一个接受 2 个参数的 API - 开始时间和结束时间,并返回新创建的帐户详细信息列表。
示例 serverA 公开:REST GET Api 看起来像这样
http://somedomainname.com/getAccounts?startTime={say currentTime-15minutes}&endTime={say currentTime}
回复:
{[
123,
456,
789
....
]} // List of account numbers that was created in serverA between supplied start time and end time.
作为 clientA,我必须定期(比如每 15 分钟)调用上述 API 并将更新存储在我的客户端数据库中。 什么是设计我的 clientA 系统调用 serverA API、检索更新并存储在我的客户端数据库中的最佳方法,考虑容错性,例如 serverA 因任何原因关闭或 clientA 本身关闭或任何其他意外错误场景。我也想避免重试机制中的重复调用。
很高兴听到您对此的意见。 我的客户端将使用 Spring Boot 框架用 Java 语言编写
【问题讨论】:
标签: rest web-services architecture spring-rest system-design