You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by cs...@apache.org on 2023/04/27 09:36:50 UTC

[rocketmq-client-go] branch master updated: fix can't send batch message error (#1040)

This is an automated email from the ASF dual-hosted git repository.

cserwen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git


The following commit(s) were added to refs/heads/master by this push:
     new d5f5776  fix can't send batch message error (#1040)
d5f5776 is described below

commit d5f5776ed7ced6d1df3763ed0014e84078a0706b
Author: tiger lee <fr...@outlook.com>
AuthorDate: Thu Apr 27 17:36:43 2023 +0800

    fix can't send batch message error (#1040)
---
 producer/producer.go | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/producer/producer.go b/producer/producer.go
index 5586846..ebd5e33 100644
--- a/producer/producer.go
+++ b/producer/producer.go
@@ -492,16 +492,18 @@ func (p *defaultProducer) buildSendRequest(mq *primitive.MessageQueue,
 	}
 
 	req := &internal.SendMessageRequestHeader{
-		ProducerGroup:  p.group,
-		Topic:          mq.Topic,
-		QueueId:        mq.QueueId,
-		SysFlag:        sysFlag,
-		BornTimestamp:  time.Now().UnixNano() / int64(time.Millisecond),
-		Flag:           msg.Flag,
-		Properties:     msg.MarshallProperties(),
-		ReconsumeTimes: 0,
-		UnitMode:       p.options.UnitMode,
-		Batch:          msg.Batch,
+		ProducerGroup:         p.group,
+		Topic:                 mq.Topic,
+		QueueId:               mq.QueueId,
+		SysFlag:               sysFlag,
+		BornTimestamp:         time.Now().UnixNano() / int64(time.Millisecond),
+		Flag:                  msg.Flag,
+		Properties:            msg.MarshallProperties(),
+		ReconsumeTimes:        0,
+		UnitMode:              p.options.UnitMode,
+		Batch:                 msg.Batch,
+		DefaultTopic:          p.options.CreateTopicKey,
+		DefaultTopicQueueNums: p.options.DefaultTopicQueueNums,
 	}
 
 	msgType := msg.GetProperty(primitive.PropertyMsgType)