Demogorgon314 commented on code in PR #21091:
URL: https://github.com/apache/pulsar/pull/21091#discussion_r1312776449


##########
pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawBatchMessageContainerImpl.java:
##########
@@ -44,16 +44,17 @@
  * [(k1, v1), (k2, v1), (k3, v1), (k1, v2), (k2, v2), (k3, v2), (k1, v3), (k2, 
v3), (k3, v3)]
  */
 public class RawBatchMessageContainerImpl extends BatchMessageContainerImpl {
-    MessageCrypto msgCrypto;
-    Set<String> encryptionKeys;
-    CryptoKeyReader cryptoKeyReader;
+    private MessageCrypto<MessageMetadata, MessageMetadata> msgCrypto;
+    private Set<String> encryptionKeys;
+    private CryptoKeyReader cryptoKeyReader;
+    private MessageIdImpl lastAddedMessageId;
 
-    public RawBatchMessageContainerImpl(int maxNumMessagesInBatch, int 
maxBytesInBatch) {
+    public RawBatchMessageContainerImpl() {
         super();
         this.compressionType = CompressionType.NONE;
         this.compressor = new CompressionCodecNone();
-        this.maxNumMessagesInBatch = maxNumMessagesInBatch;
-        this.maxBytesInBatch = maxBytesInBatch;
+        this.maxNumMessagesInBatch = Integer.MAX_VALUE;
+        this.maxBytesInBatch = Integer.MAX_VALUE;

Review Comment:
   You can see we called `super.add(msg, callback);`, in this method, it will 
use the `isBatchFull` method. Override is not working for the parent class.
   
   ```
       @Override
       public boolean add(MessageImpl<?> msg, SendCallback callback) {
           this.lastAddedMessageId = (MessageIdAdv) msg.getMessageId();
           return super.add(msg, callback);
       }
   ```



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