PatrykWitkowski opened a new issue, #18395: URL: https://github.com/apache/pulsar/issues/18395
### Search before asking - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar. ### Version 2.7.2 ### Minimal reproduce step - send a message to some topic using pulsar client below 2.7.2 - upgrade pulsar client to 2.7.2 or above - try to consume that message and retrieve message id using: MessageId.fromByteArrayWithTopic() ### What did you expect to see? the message is consumed correctly and I got a message id ### What did you see instead? the exception that "batch_size" field is not set is thrown  ### Anything else? I found in the source code that for the: MessageId.fromByteArray() that backward compatibility was preserved by adding the check if that "batch_size" exist: MessageIdImpl.fromByteArray(): ``` if (idData.hasBatchSize()) { messageId = new BatchMessageIdImpl(idData.getLedgerId(), idData.getEntryId(), idData.getPartition(), idData.getBatchIndex(), idData.getBatchSize(), BatchMessageAcker.newAcker(idData.getBatchSize())); } else { messageId = new BatchMessageIdImpl(idData.getLedgerId(), idData.getEntryId(), idData.getPartition(), idData.getBatchIndex()); } ``` and I think that something like this should be added as well to the MessageIdImpl.fromByteArrayWithTopic() where now a check like this is missing. ### Are you willing to submit a PR? - [ ] I'm willing to submit a PR! -- 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]
