We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
encodeBatch()
1 parent a7b2db6 commit 7f60ab9Copy full SHA for 7f60ab9
producer/producer.go
@@ -130,15 +130,8 @@ func (p *defaultProducer) encodeBatch(msgs ...*primitive.Message) *primitive.Mes
130
batch := new(primitive.Message)
131
batch.Topic = msgs[0].Topic
132
batch.Queue = msgs[0].Queue
133
- if len(msgs) > 1 {
134
- batch.Body = MarshalMessageBatch(msgs...)
135
- batch.Batch = true
136
- } else {
137
- batch.Body = msgs[0].Body
138
- batch.Flag = msgs[0].Flag
139
- batch.WithProperties(msgs[0].GetProperties())
140
- batch.TransactionId = msgs[0].TransactionId
141
- }
+ batch.Body = MarshalMessageBatch(msgs...)
+ batch.Batch = true
142
return batch
143
}
144
0 commit comments