知识卡片
注册服务完整生命周期
运行时服务注册表RSR记录服务在哪里、支持何种功能、媒体类型和词汇,供机器动态发现。服务启动时注册,按注册返回的URL和周期保活,正常关闭时注销;崩溃来不及注销时由注册表按心跳超时淘汰。
每个可运行实例或版本单独登记,同一实例也可登记多个注册表。增加profile、定义文档与标签可提高可发现性;注册通常需要认证。这些是服务内部生命周期能力,不必开放成面向一般消费者的业务动作。
结构图:
flowchart TD
A[服务实例启动] --> B[注册地址和能力]
B --> C[按约定周期保活]
C --> D{停止方式}
D -->|受控关闭| E[主动注销]
D -->|异常退出| F[无法继续保活]
F --> G[注册表超时淘汰]
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 超媒体服务 · 查看原书依据
For a service to be easily discovered and (re)used on the web at runtime, it should support the following: Register on startup When the service is deployed, it should automatically self-register with one or more RSRs. This makes sure other services can find it when it is needed.
参考来源
- 位置:《RESTful Web API Patterns and Practices Cookbook》第5章《Hypermedia Services》(来源项目book-sources:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch05.xhtml,配方5.13)
- 结论依据:原文要求启动注册、定期保活及停止注销,另以心跳超时处理崩溃未注销,并列出能力元数据。
- 原始内容:For a service to be easily discovered and (re)used on the web at runtime, it should support the following: Register on startup When the service is deployed, it should automatically self-register with one or more RSRs. This makes sure other services can find it when it is needed.