leoxchang opened a new issue #387:
URL: https://github.com/apache/rocketmq-spring/issues/387


   environment: rocketmq-spring-boot-starter2.2.0
   when DefaultRocketMQListenerContainer class call initRocketMQPushConsumer 
method, the rocketmq consumer call setInstanceName method, through code we see 
the same nameserver has the same instancename.
   DefaultRocketMQListenerContainer:
   ```
           consumer.setInstanceName(RocketMQUtil.getInstanceName(nameServer));
   ```
   RocketMQUtil:
   ```
       public static String getInstanceName(String identify) {
           char separator = '@';
           StringBuilder instanceName = new StringBuilder();
           instanceName.append(identify)
                   .append(separator).append(UtilAll.getPid());
           return instanceName.toString();
       }
   ```
   when the ip is same ,the rocketmq clientid the same too.
   but the rocketmq4.9.1,the code has changed:
   ```
       public void changeInstanceNameToPID() {
           if (this.instanceName.equals("DEFAULT")) {
               this.instanceName = UtilAll.getPid() + "#" + System.nanoTime();
           }
       }
   ```
   it's has add time to the instancename; so the rocketmq clientId can not be 
the same.
   can we  change the code like this?
   


-- 
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