Skip to content

Commit

Permalink
cherry pick apache#16915 to branch 2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicklee007 authored and nicklixinyang committed Aug 5, 2022
1 parent c2b685b commit 3e66e55
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -199,6 +199,7 @@ public boolean isMultiBatches() {
public OpSendMsg createOpSendMsg() throws IOException {
ByteBuf encryptedPayload = producer.encryptMessage(messageMetadata, getCompressedBatchMetadataAndPayload());
if (encryptedPayload.readableBytes() > ClientCnx.getMaxMessageSize()) {
producer.semaphoreRelease(messages.size());
discard(new PulsarClientException.InvalidMessageException(
"Message size is bigger than " + ClientCnx.getMaxMessageSize() + " bytes"));
return null;
Expand Down

0 comments on commit 3e66e55

Please sign in to comment.