报错代码
sh mqadmin updatetopic -t TestTopic -c DefaultCluster
报错:
[error] Make sure the specified clusterName exists or the name server connected to is correct.TopicConfig [topicName=TestTopic, readQueueNums=8, writeQueueNums=8, perm=RW-, topicFilterType=SINGLE_TAG, topicSysFlag=0, order=false, attributes={}]
之前还可能会出现空指针异常。
原因:
这个教程是有错误的,因为他没有设置brokerClusterName;
在broker.conf中设置
brokerIP1=127.0.0.1
# 集群名称
brokerClusterName=DefaultCluster
就能够找到集群名字后在broker容器里面创建topic
另外注意点
String endpoint = "127.0.0.1:8080;127.0.0.1:8081";