lixinwen edited a comment on issue #1589:
URL: https://github.com/apache/rocketmq/issues/1589#issuecomment-557467562


   I still recommend that rocketmq itself avoid this problem. 
   In our production environment, there was an accident.
   In the docker environment, two tomcat processes are started without their 
knowledge.
   
   Can be modified as follows:
   ConsumerGroupInfo#updateChannel
   synchronized (registerLock) {
        ......
        ClientChannelInfo infoOld = 
this.channelInfoTable.get(infoNew.getChannel());
        if (null == infoOld) {
                for (ClientChannelInfo channelInfo : channelInfoTable.values()) 
{
                        if (clientId.equals(channelInfo.getClientId())) {
                                if (channel != channelInfo.getChannel()) {
                                        log.error("channel[{}] found duplicated 
clientId[{}], exists consumer: {}", channel, clientId,
                                                        channelInfo);
                                        // Catch the exception in 
ClientManageProcessor#headBeat() and close the channel, or close it directly 
here.
                                        throw new 
ClientRegisterException("Duplicated clientId " + 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:
[email protected]


Reply via email to