> For the complete documentation index, see [llms.txt](https://lewiszlw.gitbook.io/notebooks/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lewiszlw.gitbook.io/notebooks/communication/messagqueue.md).

# Messaging

## 消息队列顺序消费设计

1.独有消费者，如Activemq，一次发送消息给一个消费者。 2.拆分多个queue，每个queue对应一个consumer，有相关性的数据按顺序写入一个queue，consumer按顺序消费。如Kafka，消费者采用多线程消费消息之前，将相同订单ID的数据，订单ID数据hash一下写入同一个内存队列（是有顺序的），然后交给线程去处理。

## xxx
