则在注册 producer 之前,如果设置的 group 不是默认的,则每次 获取的 mQClientFactory 都是不同的,而 producerTable 是 mQClientFactory 类里的一个属性,这样当然 producerTable 也是不同的,这样注册 producer 当然是注册到不同的 producerTable 中去了,所以不会报错。 if(!this.defaultMQProducer.getProducerGroup...
mQClientFactory.registerProducer(this.defaultMQProducer.getProducerGroup(), this); if (!registerOK) { this.serviceState = ServiceState.CREATE_JUST; throw new MQClientException("The producer group[" + this.defaultMQProducer.getProducerGroup() + "] has been created before, specify another name ...
Seehttp://rocketmq.apache.org/docs/faq/for further details.; nested exception is org.apache.rocketmq.client.exception.MQClientException: The producer group[SALES_PAY_NOTIFY] has been created before, specify another name please. Seehttp://rocketmq.apache.org/docs/faq/for further details. ...
mQClientFactory.registerProducer(this.defaultMQProducer.getProducerGroup(), this); if (!registerOK) { this.serviceState = ServiceState.CREATE_JUST; throw new MQClientException("The producer group[" + this.defaultMQProducer.getProducerGroup() + "] has been created before, specify another name ...
throw new MQClientException("The producer group[" + this.defaultMQProducer.getProducerGroup() + "] has been created before, specify another name please." + FAQUrl.suggestTodo(FAQUrl.GROUP_NAME_DUPLICATE_URL), null); } this.topicPublishInfoTable.put(this.defaultMQProducer.getCreateTopicKey(),...
boolean registerOK = mQClientFactory.registerProducer(this.defaultMQProducer.getProducerGroup(), this); if (!registerOK) { this.serviceState = ServiceState.CREATE_JUST; throw new MQClientException("The producer group[" + this.defaultMQProducer.getProducerGroup() + "] has been created before, sp...
公众号:网络技术联盟站,InfoQ签约作者,阿里云社区签约作者,华为云 云享专家,BOSS直聘 创作王者,腾讯...
publicstaticvoidmain(String[]args)throwsMQClientException,InterruptedException{//创建默认的生产者DefaultMQProducerproducer=newDefaultMQProducer("please_rename_unique_group_name");//设置 Name Server服务器的地址producer.setNamesrvAddr("name-server1-ip:9876;name-server2-ip:9876");//启动生产者producer.start...
首先进入 start 方法,可以看出主要的功能实现在于 defaultMQProducerImpl.start(),先忽略细枝末节,接着进去看看 public void start() throws MQClientException { this.setProducerGroup(withNamespace(this.producerGroup)); this.defaultMQProducerImpl.start(); if (null != traceDispatcher) { try { traceDispatch...
getProducerGroup()+ "] has been created before, specify another name please." + FAQUrl.suggestTodo(FAQUrl.GROUP_NAME_DUPLICATE_URL),null); } // 生产者启动是,默认的 topic = TBW102 , 放入到本地的topic的ConcurrentHashMap中 this.topicPublishInfoTable.put(this.defaultMQProducer.getCreateTopicKe...