Technoboy- commented on code in PR #23681:
URL: https://github.com/apache/pulsar/pull/23681#discussion_r1872477916


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:
##########
@@ -2413,11 +2413,16 @@ private void recoverProcessOpSendMsgFrom(ClientCnx cnx, 
MessageImpl from, long e
     private boolean isMessageSizeExceeded(OpSendMsg op) {
         if (op.msg != null && !conf.isChunkingEnabled()) {
             int messageSize = op.getMessageHeaderAndPayloadSize();
-            if (messageSize > getMaxMessageSize()) {
+            int maxMessageSize = getMaxMessageSize();
+            if (messageSize > maxMessageSize) {
+                // Log the message size exceeding the limit
+                log.warn("Message size exceeded: Producer {} attempted to send 
a message of {} bytes, "
+                                + "exceeding the configured maximum size of {} 
bytes on topic {}.",
+                        producerName, messageSize, maxMessageSize, topic);

Review Comment:
   Seems useless for this log, the client could get the exception with log 
below.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to