watsy0007 opened a new issue #426: [v2.0.0-rc1] query topic route from server 
error 
URL: https://github.com/apache/rocketmq-client-go/issues/426
 
 
   1.2.4 客户端可以使用.
   尝试升级使用2.0.0rc-1, 得到如下错误提示
   
   ```shell
   INFO[0000] the consumer start beginning                  
consumerGroup=GID-dev-market-futures messageModel=Clustering unitMode=false
   WARN[0000] query topic route from server error           
underlayError="topic not exist"
   WARN[0000] query topic route from server error           
underlayError="topic not exist"
   WARN[0000] do balance in group failed, the topic does not exist  
consumerGroup=GID-dev-market-futures topic=dev_market_futures
   WARN[0000] do balance in group failed, the topic does not exist  
consumerGroup=GID-dev-market-futures topic="%RETRY%GID-dev-market-futures"
   WARN[0001] query topic route from server error           
underlayError="topic not exist"
   WARN[0001] query topic route from server error           
underlayError="topic not exist"
   
   ```
   
   代码
   ```go
   
   func (m *MQ) consumerWithOrderly() error {
        c, err := rocketmq.NewPushConsumer(
                consumer.WithGroupName(G.MQ.GroupID),
                consumer.WithNameServer([]string{G.MQ.TCP.Host}),
                consumer.WithCredentials(primitive.Credentials{
                        AccessKey:     G.MQ.Credentials.AccessKey,
                        SecretKey:     G.MQ.Credentials.SecretKey,
                        SecurityToken: "",
                }),
                consumer.WithConsumerModel(consumer.Clustering),
                consumer.WithConsumeFromWhere(consumer.ConsumeFromFirstOffset),
                consumer.WithConsumerOrder(true),
                //consumer.WithNameServerDomain(G.MQ.TCP.Host),
        )
   
        if err != nil {
               return err
        }
   
        err = c.Subscribe(G.MQ.Topic, consumer.MessageSelector{}, func(ctx 
context.Context, ext ...*primitive.MessageExt) (consumer.ConsumeResult, error) {
   
                orderlyCtx, _ := primitive.GetOrderlyCtx(ctx)
                fmt.Printf("orderly context: %v\n", orderlyCtx)
                fmt.Printf("subscribe orderly callback: %v \n", ext)
   
                //if m.ProcessMessage != nil {
                //      m.ProcessMessage(ext.Body)
                //}
                return consumer.ConsumeSuccess, nil
        })
   
        if err != nil {
               return err
        }
        err = c.Start()
        if err != nil {
               return err
        }
           <-m.exit
        err = c.Shutdown()
        if err != nil {
               return err
        }
           return nil
   }
   ```

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


With regards,
Apache Git Services

Reply via email to