You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/11/10 08:08:27 UTC
[GitHub] [pulsar] BewareMyPower commented on a diff in pull request #18405: [fix][client] Fixes batch_size not checked in MessageId#fromByteArrayWithTopic
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org