wolfstudy commented on a change in pull request #263: URL: https://github.com/apache/pulsar-client-go/pull/263#discussion_r431529838
########## File path: pulsar/producer_partition.go ########## @@ -236,6 +239,16 @@ func (p *partitionProducer) internalSend(request *sendRequest) { msg := request.msg + // if msg is too large + if len(msg.Payload) > int(p.cnx.GetMaxMessageSize()) { + p.publishSemaphore.Release() + request.callback(nil, request.msg, errMessageTooLarge) + p.log.WithField("size", len(msg.Payload)). + WithField("properties", msg.Properties). + Error("message size exceeds MaxMessageSize") Review comment: Thanks @jinfengnarvar thanks for pointing this out. Currently, there are some inconsistencies in the handling of errors. In order to ensure the structured output of the log, we should use `withError()` instead of `Error()`. I send an [issue](https://github.com/apache/pulsar-client-go/issues/264) to track this issue. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org