GPrabhudas commented on a change in pull request #560:
URL: https://github.com/apache/pulsar-client-go/pull/560#discussion_r667854736
##########
File path: pulsar/producer_partition.go
##########
@@ -197,30 +248,32 @@ func (p *partitionProducer) grabCnx() error {
}
p.producerName = res.Response.ProducerSuccess.GetProducerName()
+
+ var provider internal.BatcherBuilderProvider
if p.options.DisableBatching {
- provider, _ := GetBatcherBuilderProvider(DefaultBatchBuilder)
- p.batchBuilder, err = provider(p.options.BatchingMaxMessages,
p.options.BatchingMaxSize,
- p.producerName, p.producerID,
pb.CompressionType(p.options.CompressionType),
- compression.Level(p.options.CompressionLevel),
- p,
- p.log)
- if err != nil {
- return err
- }
+ provider, _ = GetBatcherBuilderProvider(DefaultBatchBuilder)
+
} else if p.batchBuilder == nil {
- provider, err :=
GetBatcherBuilderProvider(p.options.BatcherBuilderType)
Review comment:
Just tried to remove duplicate code :) If it is not ok, I'll revert it.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]