Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
RocketMQ:主题的队列如何映射到主代理?_Rocketmq - Fatal编程技术网

RocketMQ:主题的队列如何映射到主代理?

RocketMQ:主题的队列如何映射到主代理?,rocketmq,Rocketmq,我知道,在RocketMq中,“队列”类似于卡夫卡中的“分区”。 一个主题有多个队列,也有多个代理(主代理和从代理) 但是队列是如何映射到主队列的呢 例如,如果我有一个包含3个队列和3个主控项的主题。3个队列分布在3个主机之间?或者每个主机有3个队列?您可以在创建主题时指定队列号: sh mqadmin updateTopic -h usage: mqadmin updateTopic [-b <arg>] [-c <arg>] [-h] [-n <arg>]

我知道,在RocketMq中,“队列”类似于卡夫卡中的“分区”。 一个主题有多个队列,也有多个代理(主代理和从代理)

但是队列是如何映射到主队列的呢


例如,如果我有一个包含3个队列和3个主控项的主题。3个队列分布在3个主机之间?或者每个主机有3个队列?

您可以在创建主题时指定队列号:

sh mqadmin updateTopic -h
usage: mqadmin updateTopic [-b <arg>] [-c <arg>] [-h] [-n <arg>] [-o <arg>] [-p <arg>] [-r <arg>] [-s <arg>]
       -t <arg> [-u <arg>] [-w <arg>]
 -b,--brokerAddr <arg>       create topic to which broker
 -c,--clusterName <arg>      create topic to which cluster
 -h,--help                   Print help
 -n,--namesrvAddr <arg>      Name server address list, eg: 192.168.0.1:9876;192.168.0.2:9876
 -o,--order <arg>            set topic's order(true|false
 -p,--perm <arg>             set topic's permission(2|4|6), intro[2:W 4:R; 6:RW]
 -r,--readQueueNums <arg>    set read queue nums
 -s,--hasUnitSub <arg>       has unit sub (true|false
 -t,--topic <arg>            topic name
 -u,--unit <arg>             is unit topic (true|false
 -w,--writeQueueNums <arg>   set write queue nums
sh mqadmin updateTopic-h

用法:mqadmin updateTopic[-b.

但是队列在实现中是如何映射到主机的?我已经阅读了源代码,发现管理控制台在创建主题时会将主题发送给所有主机,但是主机如何划分主题的队列?使用
-b
在指定的代理中创建主题,并使用
-r
-w
顺便说一句,我通过阅读源代码解决了这个问题。