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 2021/04/06 09:55:56 UTC

[GitHub] [rocketmq] crazy-pizza opened a new issue #2782: Why does BROADCASTING consumer use different MQClientInstance than CLUSTERING consumer

crazy-pizza opened a new issue #2782:
URL: https://github.com/apache/rocketmq/issues/2782


   Here is the source code for MQ
   ```
   if (this.defaultMQPushConsumer.getMessageModel() == MessageModel.CLUSTERING) {
        this.defaultMQPushConsumer.changeInstanceNameToPID();
    }
   ```


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] crazy-pizza edited a comment on issue #2782: Why does BROADCASTING consumer use different MQClientInstance than CLUSTERING consumer

Posted by GitBox <gi...@apache.org>.
crazy-pizza edited a comment on issue #2782:
URL: https://github.com/apache/rocketmq/issues/2782#issuecomment-816378680


   > InstanceName is used to splice clientId,the broadcast mode does not require consumer rebalance, and there is no need to ensure that the ClientId is different.
   
   我明白你的意思,你是站着集群模式消费的角度考虑的。
   但是我想说的是,如果广播消费的instanceName也使用PID,就可以在一个进程内与集群消费共享网络连接。
   
   并且由于广播消费的消费进度存储在本地,位置在: 
   ```
   this.storePath = LOCAL_OFFSET_STORE_DIR + File.separator +
               this.mQClientFactory.getClientId() + File.separator +
               this.groupName + File.separator +
               "offsets.json";
   ```
   如果广播消费的instanceName固定是DEFAULT的话,那么将不能在一台机器上启动两个相同组名的消费者,否则Offset存储会发生冲突
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] panzhi33 commented on issue #2782: Why does BROADCASTING consumer use different MQClientInstance than CLUSTERING consumer

Posted by GitBox <gi...@apache.org>.
panzhi33 commented on issue #2782:
URL: https://github.com/apache/rocketmq/issues/2782#issuecomment-814643880


   InstanceName is used to splice clientId,the broadcast mode does not require consumer rebalance, and there is no need to ensure that the ClientId is different.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] crazy-pizza edited a comment on issue #2782: Why does BROADCASTING consumer use different MQClientInstance than CLUSTERING consumer

Posted by GitBox <gi...@apache.org>.
crazy-pizza edited a comment on issue #2782:
URL: https://github.com/apache/rocketmq/issues/2782#issuecomment-816378680


   > InstanceName is used to splice clientId,the broadcast mode does not require consumer rebalance, and there is no need to ensure that the ClientId is different.
   
   我明白你的意思,你是站着集群模式消费的角度考虑的。
   但是我想说的是,如果广播消费的instanceName也使用PID,就可以在一个进程内与集群消费共享网络连接。
   
   并且由于广播消费的消费进度存储在本地,位置在: 
   ```
   this.storePath = LOCAL_OFFSET_STORE_DIR + File.separator +
               this.mQClientFactory.getClientId() + File.separator +
               this.groupName + File.separator +
               "offsets.json";
   ```
   如果广播消费的instanceName固定是DEFAULT的话,那么将不能在一台机器上启动两个相同组名的消费者,否则Offset存储会发生冲突。所以,广播消费也应该要确保ClientId是不同的。
   当然,对于上面的Case,用户也可以自己手动修改instanceName,但是我觉得这些问题可以提前规避。


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] duhenglucky closed issue #2782: Why does BROADCASTING consumer use different MQClientInstance than CLUSTERING consumer

Posted by GitBox <gi...@apache.org>.
duhenglucky closed issue #2782:
URL: https://github.com/apache/rocketmq/issues/2782


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] crazy-pizza edited a comment on issue #2782: Why does BROADCASTING consumer use different MQClientInstance than CLUSTERING consumer

Posted by GitBox <gi...@apache.org>.
crazy-pizza edited a comment on issue #2782:
URL: https://github.com/apache/rocketmq/issues/2782#issuecomment-816378680


   > InstanceName is used to splice clientId,the broadcast mode does not require consumer rebalance, and there is no need to ensure that the ClientId is different.
   
   我明白你的意思,你是站着集群模式消费的角度考虑的。
   但是我想说的是,如果广播消费的instanceName也使用PID,就可以在一个进程内与集群消费共享网络连接。
   
   并且由于广播消费的消费进度存储在本地,位置在: 
   ```
   this.storePath = LOCAL_OFFSET_STORE_DIR + File.separator +
               this.mQClientFactory.getClientId() + File.separator +
               this.groupName + File.separator +
               "offsets.json";
   ```
   如果广播消费的instanceName固定是DEFAULT的话,那么将不能在一台机器上启动两个相同组名的消费者,否则Offset存储会发生冲突。所以,广播消费也应该要确保ClientId是不同的。
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] crazy-pizza commented on issue #2782: Why does BROADCASTING consumer use different MQClientInstance than CLUSTERING consumer

Posted by GitBox <gi...@apache.org>.
crazy-pizza commented on issue #2782:
URL: https://github.com/apache/rocketmq/issues/2782#issuecomment-816378680


   > InstanceName is used to splice clientId,the broadcast mode does not require consumer rebalance, and there is no need to ensure that the ClientId is different.
   
   我明白你的意思,你是站着集群模式消费的角度考虑的。
   但是我想说的是,如果广播消费的instanceName也使用PID,就可以在一个进程内与集群消费共享网络连接。
   
   并且由于广播消费的消费进度存储在本地,位置在: 
   ```
   this.storePath = LOCAL_OFFSET_STORE_DIR + File.separator +
               this.mQClientFactory.getClientId() + File.separator +
               this.groupName + File.separator +
               "offsets.json";
   ```
   如果广播消费的instanceName固定是DEFAULT的话,那么将不能在一台机器上启动两个相同组的消费组,否则Offset存储会发生冲突
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] panzhi33 commented on issue #2782: Why does BROADCASTING consumer use different MQClientInstance than CLUSTERING consumer

Posted by GitBox <gi...@apache.org>.
panzhi33 commented on issue #2782:
URL: https://github.com/apache/rocketmq/issues/2782#issuecomment-816466877


   重启服务的话,pid是会改变的,也就改变了消费进度的存储位置,这两个是矛盾的。
   广播模式消费进度是存储再本地的,同一台机器的话,还是建议客户端修改存储位置LOCAL_OFFSET_STORE_DIR
   你说的也是对的,我们可以想想其它的标识符,来解决这个问题


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org