This repository was archived by the owner on Apr 1, 2024. It is now read-only.

Description
Original Issue: apache#17188
Search before asking
Motivation
PIP 132 Include message header size when check maxMessageSize for non-batch message on the client side
Current c++ the implementation also has this problem.
const bool compressed = !canAddToBatch(msg);
const auto payload =
compressed ? applyCompression(uncompressedPayload, conf_.getCompressionType()) : uncompressedPayload;
const auto compressedSize = static_cast<uint32_t>(payload.readableBytes());
const auto maxMessageSize = static_cast<uint32_t>(ClientConnection::getMaxMessageSize());
if (compressed && compressedSize > ClientConnection::getMaxMessageSize() && !chunkingEnabled_) {
LOG_WARN(getName() << " - compressed Message payload size " << payload.readableBytes()
<< " cannot exceed " << ClientConnection::getMaxMessageSize()
<< " bytes unless chunking is enabled");
handleFailedResult(ResultMessageTooBig);
return;
}
Solution
Refer java client PR: apache#14007
Alternatives
No response
Anything else?
This is a PR to match the Java implementation. It is best to first prove whether the problem exists in the C++ client, and then solve it.
Are you willing to submit a PR?