rdhabalia commented on a change in pull request #541: Message size validation
on post compression
URL: https://github.com/apache/incubator-pulsar/pull/541#discussion_r124979748
##########
File path: pulsar-client-cpp/lib/ProducerImpl.cc
##########
@@ -268,6 +264,14 @@ void ProducerImpl::sendAsync(const Message& msg,
SendCallback callback) {
// If batching is enabled we compress all the payloads together before
sending the batch
payload =
CompressionCodecProvider::getCodec(conf_.getCompressionType()).encode(payload);
}
+ uint32_t compressedSize = payload.readableBytes();
+ if (compressedSize > Commands::MaxMessageSize) {
+ if (conf_.getBlockIfQueueFull()) {
+ pendingMessagesQueue_.release(1);
+ }
+ cb(ResultMessageTooBig, msg);
Review comment:
yes, added a debug log.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services