BingCoke opened a new issue, #5555:
URL: https://github.com/apache/rocketmq/issues/5555

   as we know when producer start,it will create a InstanceName with 
(pid+nanoTime) by default
   
   in ClientConfig.java
   
![image](https://user-images.githubusercontent.com/81607010/202906498-909064ae-a1f1-4231-973d-0f421fd5f020.png)
   
   and then produce create a client Instance 
   
   in MQClientManager.java
   
![image](https://user-images.githubusercontent.com/81607010/202906628-5188131c-cfda-4418-9712-c7c24859fa84.png)
   
   in ClientConfig.java
   
![image](https://user-images.githubusercontent.com/81607010/202906647-0c6c2dc8-dd4c-4702-be1a-2559a5bd496d.png)
   we will find instance by clientid that depends on instance name . 
   so is look like instance and producer have one-to-one correspondence 
relation. Till this moment everything is OK, but produce will registerProducer 
after create MQClient.
   
   
    in MQClientInstance.java
   
![image](https://user-images.githubusercontent.com/81607010/202907191-5c067e9b-1dd8-41e6-aaa5-3f7a37c37445.png)
   It seems that we use a produceTable to manage producers,but as we know this 
Instance will never have the other producer because we create instance name 
with nano and that lead to all producers will get their own instance!
   
   And  MQClientInstance has fields to manager consumer and producer.
   
![image](https://user-images.githubusercontent.com/81607010/202907662-81224480-0c0e-41ff-b6d1-62f6d2c2b7ed.png)
   So it is seems that it is designed for managing consumer and producer 
together because the producerTable and consumerTable will be created by default 
when instance is created.
   
   So I think is not a good idea to use PID + nano to build a producer or 
consumer.It's enough to manage producer and consumer with one MQClientInstance.
   
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to