知识卡片
队列与主题按消费者需求取舍
原书用交易服务通知分析、报告等消费者的教学场景比较两种发布拓扑:
| 关注点 | 每消费者一条队列 | 共同主题 |
|---|---|---|
| 消息与权限 | 可按消费者定制内容和访问 | 订阅者看到同一消息,需检查数据暴露 |
| 新增消费者 | 发布者增加投递路径 | 新订阅者可不改发布者 |
| 监控与扩容 | 各队列可分别观察和调整 | 需另行设计消费者级观测与隔离 |
选型应依安全、扩展和运维目标判断;主题本身不能保证任何消费者都能安全订阅。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- The Laws of Software Architecture, Revisited · 查看原书依据
If security is more important, you should probably select queues. If the organization is growing rapidly and has other services interested in trades, then extensibility might be a priority, which would lead you to use topics.
参考来源
- 位置:《Fundamentals of Software Architecture》原书第27章《The Laws of Software Architecture, Revisited》(阅读计划第31项,单元04;源文件:`OEBPS/ch27.html`)
- 结论依据:原书用交易通知假设案例比较队列与主题在消息差异、耦合、监控、扩展和安全上的取舍;表格为归纳。
- 原始内容:If security is more important, you should probably select queues. If the organization is growing rapidly and has other services interested in trades, then extensibility might be a priority, which would lead you to use topics.