知识卡片
队列与发布订阅目的不同
队列用于可靠地分配待处理任务,让并行执行者不必相互等待;发布订阅用于把事件通知给感兴趣的参与方。持久代理可在处理者确认后推进消息处理。具体投递、保留和确认语义取决于实现,不能从支持异步推出“只处理一次”,也不能把不同产品的语义一概而论。
相关:[[路由治理与消息中介分工]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 宏观架构导论 · 查看原书依据
We use the message queue for reliable asynchronous processing when we want to distribute tasks across multiple threads of executions without one task having to wait on the other tasks to finish. We use the Pub/Sub pattern to notify interested parties about events.
参考来源
- 位置:《Software Architecture and Decision-Making》第5章《宏观架构导论》(来源项目:book-sources;源文件:extracted/Software Architecture and Decision-Making Leveraging Leadership, Technology, and Product Management to Build Great Products… (Srinath Perera)/_epub-src/ch05.xhtml)
- 结论依据:原文的定义、比较或例子支持“队列用于可靠地分配待处理任务,让并行执行者不必相互等待;发布订阅用于把事件通知给感兴趣的参与方”;正文据此说明用途和边界。
- 原始内容:We use the message queue for reliable asynchronous processing when we want to distribute tasks across multiple threads of executions without one task having to wait on the other tasks to finish. We use the Pub/Sub pattern to notify interested parties about events.