lhotari commented on code in PR #23954:
URL: https://github.com/apache/pulsar/pull/23954#discussion_r2056379622


##########
pulsar-io/kafka/src/main/java/org/apache/pulsar/io/kafka/KafkaBytesSource.java:
##########
@@ -230,25 +271,31 @@ public BytesWithKafkaSchema deserialize(String topic, 
byte[] payload) {
                     ByteBuffer buffer = ByteBuffer.wrap(payload);
                     buffer.get(); // magic number
                     int id = buffer.getInt();
-                    return new BytesWithKafkaSchema(buffer, id);
+                    // the kafka protobuf serializer encodes the 
MessageIndexes in the payload, we need to skip them
+                    if (schemaType == SchemaType.PROTOBUF_NATIVE) {
+                        MessageIndexes.readFrom(buffer);
+                    }

Review Comment:
   [wire format 
docs](https://docs.confluent.io/platform/current/schema-registry/fundamentals/serdes-develop/index.html#messages-wire-format)



-- 
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-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to