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.
As defined by WithError:
```
func WithError(err error) *Entry {
return std.WithField(ErrorKey, err)
}
```
It requires an error type signature as an input parameter, but sometimes we
just want to output an error log, so for errors that are not explicitly
returned, we will use `Error()` instead of `WithError()`
For this change of @keithnull, we should adopt the scheme provided by
@jinfengnarvar, use `WithError()` instead of `Error()`.
I send an [issue:246](https://github.com/apache/pulsar-client-go/issues/264)
to track this issue. @keithnull Can you help to check if we have similar
problems in the project, if not, please close 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:
[email protected]