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/28 02:43:37 UTC

[GitHub] [rocketmq-client-go] ignorantshr opened a new issue #767: Failed to send messages in bulk

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


   **BUG REPORT**  
   1. Please describe the issue you observed:
   
       - What did you do (The steps to reproduce)?
   
   Send messages in bulkļ¼š
   
   ```go
   func main() {
   	address, err := primitive.NewNamesrvAddr("127.0.0.1:9876")
   	if err != nil {
   		log.Fatal(err)
   	}
   	p, err := rocketmq.NewProducer(
   		producer.WithNameServer(address),
   		producer.WithGroupName("uuid_1"),
   		producer.WithRetry(2),
   		)
   	if err != nil {
   		panic(err)
   	}
   	if err = p.Start(); err != nil {
   		panic(err)
   	}
   	defer p.Shutdown()
   
   	msg1 := primitive.NewMessage("hello", []byte("hi, I'm p with tag <test>!"))
   	msg1.WithTag("test")
   	msg2 := primitive.NewMessage("hello", []byte("hi, I'm p with tag <tset>!"))
   	msg2.WithTag("tset")
   	var msgs []*primitive.Message
   	msgs = append(msgs, msg1)
   	msgs = append(msgs, msg2)
   
   	result, err := p.SendSync(context.Background(), msgs...)
   	// this is ok
   	//result, err := p.SendSync(context.Background(), msg2)
   	if err != nil {
   		fmt.Printf("Failed to send message: %s\n", err)
   		return
   	}
   	fmt.Printf("Result: %s", result)
   }
   ```
   
       - What did you expect to see?
   Sent successfully
   
       - What did you see instead?
   Failed to send message:
   
   ```
   GOROOT=/opt/go #gosetup
   GOPATH=/root/go #gosetup
   /opt/go/bin/go build -o /tmp/GoLand/___go_build_producer producer #gosetup
   /tmp/GoLand/___go_build_producer
   INFO[0000] the topic route info changed                  changeTo="{\"OrderTopicConf\":\"\",\"queueDatas\":[{\"brokerName\":\"LIDC-Dev4.cs15bcloud.internal\",\"readQueueNums\":4,\"writeQueueNums\":4,\"perm\":6,\"topicSynFlag\":0}],\"brokerDatas\":[{\"cluster\":\"DefaultCluster\",\"brokerName\":\"LIDC-Dev4.cs15bcloud.internal\",\"brokerAddrs\":{\"0\":\"10.221.5.7:10911\"}}]}" changedFrom="<nil>" topic=hello
   Failed to send message: java.lang.NumberFormatException: For input string: "", java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
   INFO[0000] will remove client from clientMap             clientID=10.221.5.7@1752
   
   Process finished with the exit code 0
   
   ```
   
   2. Please tell us about your environment:
   
        - What is your OS?
   Centos7
        - What is your client version?
   rocketmq-client-go-2.1.0
        - What is your RocketMQ version?
   rocketmq-4.9.2
   3. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):
   go1.16.4


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



[GitHub] [rocketmq-client-go] HuismanKwl edited a comment on issue #767: Failed to send messages in bulk

Posted by GitBox <gi...@apache.org>.
HuismanKwl edited a comment on issue #767:
URL: https://github.com/apache/rocketmq-client-go/issues/767#issuecomment-1008779206


   try config enableBatchPush=true


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



[GitHub] [rocketmq-client-go] Git-Yang commented on issue #767: Failed to send messages in bulk

Posted by GitBox <gi...@apache.org>.
Git-Yang commented on issue #767:
URL: https://github.com/apache/rocketmq-client-go/issues/767#issuecomment-1009655197


   refer to https://github.com/apache/rocketmq-client-go/issues/683


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



[GitHub] [rocketmq-client-go] ignorantshr commented on issue #767: Failed to send messages in bulk

Posted by GitBox <gi...@apache.org>.
ignorantshr commented on issue #767:
URL: https://github.com/apache/rocketmq-client-go/issues/767#issuecomment-1002368263


   > Hi, I just researched your question and found that there are some similar answers on the Internet. Here are 2 links and hope it will help you. https://www.pianshen.com/article/99841056477/ https://blog.51cto.com/u_12132623/3065786
   
   Hi, I have read the post you mentioned. But groupName and tag are not the real reason. The real reason is that batch sending will fail. If you run the code in the [example](https://github.com/apache/rocketmq-client-go/blob/de5f56172c82d3f6633575c7904c5ab4f1c8a977/examples/producer/batch/main.go), it will also fail and the output will be the same as my code.


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



[GitHub] [rocketmq-client-go] HuismanKwl commented on issue #767: Failed to send messages in bulk

Posted by GitBox <gi...@apache.org>.
HuismanKwl commented on issue #767:
URL: https://github.com/apache/rocketmq-client-go/issues/767#issuecomment-1008779206


   try config isEnableBatchPush=true


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



[GitHub] [rocketmq-client-go] yuanmoon commented on issue #767: Failed to send messages in bulk

Posted by GitBox <gi...@apache.org>.
yuanmoon commented on issue #767:
URL: https://github.com/apache/rocketmq-client-go/issues/767#issuecomment-1002133905


   Hi, I just researched your question and found that there are some similar answers on the Internet.
   Here are 2 links and hope it will help you.
   https://www.pianshen.com/article/99841056477/
   https://blog.51cto.com/u_12132623/3065786


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