tt-live commented on issue #521:
URL: 
https://github.com/apache/rocketmq-client-go/issues/521#issuecomment-668962881


   ```
   c1, _ := rocketmq.NewPushConsumer(
                consumer.WithGroupName("testGroup"),
                
consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"192.168.31.11:9876"})),
        )
   
   c2, _ := rocketmq.NewPushConsumer(
                consumer.WithGroupName("testGroup"),
                
consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"192.168.31.12:9876"})),
        )
   
   ```
   
   
   ```
   func (c *rmqClient) ClientID() string {
        id := c.option.ClientIP + "@"
        if c.option.InstanceName == "DEFAULT" {
                id += strconv.Itoa(os.Getpid())
        } else {
                id += c.option.InstanceName
        }
        if c.option.UnitName != "" {
                id += "@" + c.option.UnitName
        }
        return id
   }
   ```
   
   ```
   
   // sync map key always the same
   actual, loaded := clientMap.LoadOrStore(client.ClientID(), client)
   
   ```
   
   when the service starts, multiple sets of clusters are connected, and 
producers or consumers are started sequentially, the client memory cache map 
always gets the handle of the first nameserver


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