You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/01/12 10:14:41 UTC

[GitHub] vancefantasy commented on issue #667: Consumer rebalance problem when using docker container

vancefantasy commented on issue #667: Consumer rebalance problem when using docker container
URL: https://github.com/apache/rocketmq/issues/667#issuecomment-453735825
 
 
   @huanwei 
   
   clientId:
   
        public String buildMQClientId() {
           StringBuilder sb = new StringBuilder();
           sb.append(this.getClientIP());
           sb.append("@");
           sb.append(this.getInstanceName());
           if (!UtilAll.isBlank(this.unitName)) {
               sb.append("@");
               sb.append(this.unitName);
           }
           return sb.toString();
       }
   
   instanceName:
   
       private String instanceName = System.getProperty("rocketmq.client.name", "DEFAULT");
   
       public void changeInstanceNameToPID() {
           if (this.instanceName.equals("DEFAULT")) {
               this.instanceName = String.valueOf(UtilAll.getPid());
           }
       }
   
   在docker环境下(使用host模式),clientIp和pid都是一样的。当然clientIp也一样的确切原因还没完全确认,[可能和引入Rancher有关](https://github.com/rancher/rancher/issues/5499)。
   
   <img width="154" alt="wx20190112-180557 2x" src="https://user-images.githubusercontent.com/42924205/51071992-c48c2300-1694-11e9-8b4b-c949f446e0a5.png">
   
   https://github.com/apache/rocketmq/pull/668
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services