bschofield edited a comment on issue #437:
URL:
https://github.com/apache/pulsar-client-go/issues/437#issuecomment-756858296
Another way to fix this seems to me to edit _batch_builder.go_,
`batchContainer.Add()` so that it return `false` if the current batch container
has too many messages instead of just too many bytes, i.e. to change
} else if bc.hasSpace(payload) {
// The current batch is full. Producer has to call Flush() to
return false
}
to
} else if bc.IsFull() || bc.hasSpace(payload) {
// The current batch is full. Producer has to call Flush() to
return false
}
(A little confusingly, the `hasSpace()` function returns `true` if there is
_not_ enough space.)
It could be the case that increasing `MaxPendingMessages` is just a band-aid
which is causing the batch containers to hit the size limit, and the real bug
is here.
However, I'm not confident enough that this is the correct fix to send a PR
for 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.
For queries about this service, please contact Infrastructure at:
[email protected]