BewareMyPower commented on code in PR #18405:
URL: https://github.com/apache/pulsar/pull/18405#discussion_r1018765810


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageIdImpl.java:
##########
@@ -155,8 +155,14 @@ public static MessageId fromByteArrayWithTopic(byte[] 
data, TopicName topicName)
 
         MessageId messageId;
         if (idData.hasBatchIndex()) {
-            messageId = new BatchMessageIdImpl(idData.getLedgerId(), 
idData.getEntryId(), idData.getPartition(),
-                idData.getBatchIndex(), idData.getBatchSize(), 
BatchMessageAcker.newAcker(idData.getBatchSize()));
+            if (idData.hasBatchSize()) {

Review Comment:
   The `batch_size` field was introduced from 
https://github.com/apache/pulsar/pull/8659, before that, the `batch_index` 
field already existed. For example, the 2.7.1 client could send such a message 
id, see https://github.com/apache/pulsar/issues/18395#issuecomment-1309864662.
   
   Other languages clients might also sent a message id that has the 
`batch_index` field but no `batch_size` field.



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