diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/converter/CustomBatchConverter.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/converter/CustomBatchConverter.java index 080992c22cc667..2a00ad88f768db 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/client/converter/CustomBatchConverter.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/converter/CustomBatchConverter.java @@ -48,7 +48,7 @@ public Iterable> convert(EntryContext context, MessagePayload pay bufList.add(buf); final CustomBatchFormat.StringIterable strings = CustomBatchFormat.deserialize(buf); final Iterator stringIterator = strings.iterator(); - final int numMessages = context.getNumMessages(); + final int numMessages = strings.size(); return () -> new Iterator>() { int index = 0;