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/12/01 08:29:54 UTC

[GitHub] [rocketmq-client-go] Zfzlv opened a new issue #747: com.alibaba.fastjson.JSONException

Zfzlv opened a new issue #747:
URL: https://github.com/apache/rocketmq-client-go/issues/747


   - broker version  V4_7_0  
   - rocketmq client go version v2.1.0
   
   ### console
   1. Operation: Resend Message
   2. trackType: UNKNOWN
   3. view exception: com.alibaba.fastjson.JSONException: No enum constant org.apache.rocketmq.remoting.protocol.LanguageCode.GO, com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:614)
   
   ## consumer code
   ```
           var c rocketmq.PushConsumer
   	c, err = rocketmq.NewPushConsumer(
   		consumer.WithGroupName("xxxx"),
   		consumer.WithNsResolver(primitive.NewPassthroughResolver("xxx")),
   		consumer.WithConsumerModel(consumer.Clustering),
   	)
   	if err != nil {
   		return
   	}
   	selector := consumer.MessageSelector{
   		Type:       consumer.TAG,
   		Expression: "xxx",
   	}
   	err = c.Subscribe("xxxx", selector, func(ctx context.Context,
   		msgs ...*primitive.MessageExt) (consumer.ConsumeResult, error) {
   		for i := range msgs {
   			log.Println(fmt.Sprintf("consumer msg msgId %s", msgs[i].MsgId))
   		}
   		return consumer.ConsumeSuccess, nil
   	})
   	if err != nil {
   		return
   	} 
   	err = c.Start()
   	if err != nil {
   		return
   	} 
   	select {
   	case <-ctx.Done():
   	}
   	_ = c.Shutdown()
   ```


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

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

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