by sharding key. default is 4 read/write queue of 1 topic.
run result log: link
- http://localhost:8180/#/topic
- create topic
single_queue_order
集群名: DefaultCluster
BROKER_NAME: broker-a
主题名: single_queue_order
写队列数量: 1
读队列数量: 1
perm: 6 # 支持同时读写
- run
SingleQueueOrderProducer.java
- run
SingleQueueOrderConsumer.java
- run
OneTopicMultiQueueProducer.java
- run
OneTopicMultiQueueConsumer.java
run result like:
cur consumer msgId: 15
cur consumer msgId: 13
cur consumer msgId: 5
cur consumer msgId: 8
cur consumer msgId: 6
cur consumer msgId: 7
cur consumer msgId: 9
cur consumer msgId: 10
cur consumer msgId: 3
cur consumer msgId: 12
cur consumer msgId: 11
msg disorder curMsgId: 4; lastMsgId: 5
cur consumer msgId: 16
cur consumer msgId: 14
msg disorder curMsgId: 1; lastMsgId: 13
msg disorder curMsgId: 0; lastMsgId: 13
cur consumer msgId: 17
msg disorder curMsgId: 2; lastMsgId: 15
cur consumer msgId: 18
cur consumer msgId: 19
- rocketmq的queue 就是 kafka的partition
- replica是副本数,和queue/partition不是一个概念