Files
nexus/wiki/concepts/消息队列.md
2026-04-22 12:02:55 +08:00

29 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "消息队列"
type: concept
tags: [software-engineering, architecture, message-queue, async, distributed-systems]
sources: [开发经验与项目规范整理文档]
last_updated: 2025-12-30
---
## Definition
**消息队列Message Queue** 是一种用于服务之间异步通信的中间件。生产者将消息发送到队列,消费者异步从队列中取出并处理,实现服务间的松耦合。
## Core Principles
- **解耦**:生产者和消费者无需同时在线,直接依赖接口
- **削峰填谷**:在高负载时缓存消息,平滑处理压力
- **异步任务处理**:非实时任务可放入队列异步处理
- **提高系统稳定性与吞吐**:通过异步处理提升系统整体吞吐量
## Related Concepts
- [[微服务架构]] — 消息队列是微服务间通信的重要方式
- [[Redis缓存]] — Redis 也可实现轻量级消息队列
- [[输入-处理-输出模型]] — 消息队列在「处理」环节的异步化作用
## Source Reference
来源:[[开发经验与项目规范整理文档]]