codingharbour / kafka-protobuf

13 stars 7 forks source link

Producer is not working #1

Closed mahfooziiitian closed 3 years ago

mahfooziiitian commented 3 years ago

Exception in thread "main" org.apache.kafka.common.errors.SerializationException: Error registering Protobuf schema: syntax = "proto3"; package com.mahfooz.kafka.protobuf;

option java_outer_classname = "SimpleMessageProtos";

message SimpleMessage { string content = 1; string date_time = 2; }

Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Unrecognized field: schemaType; error code: 422 at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:293) at io.confluent.kafka.schemaregistry.client.rest.RestService.httpRequest(RestService.java:352) at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:495) at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:486) at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:459) at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.registerAndGetId(CachedSchemaRegistryClient.java:206) at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:268) at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:244) at io.confluent.kafka.serializers.protobuf.AbstractKafkaProtobufSerializer.serializeImpl(AbstractKafkaProtobufSerializer.java:79) at io.confluent.kafka.serializers.protobuf.KafkaProtobufSerializer.serialize(KafkaProtobufSerializer.java:77) at io.confluent.kafka.serializers.protobuf.KafkaProtobufSerializer.serialize(KafkaProtobufSerializer.java:30) at org.apache.kafka.common.serialization.Serializer.serialize(Serializer.java:62) at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:903) at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:865) at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:752) at com.mahfooz.kafka.schema.protobuf.producer.ProtobufProducer.writeMessage(ProtobufProducer.java:46) at com.mahfooz.kafka.schema.protobuf.producer.ProtobufProducer.main(ProtobufProducer.java:19)

chromy96 commented 3 years ago

Hi @mahfooz

schemaType field was introduced in version 5.5 of schema registry (together with support for Protobuf and Json schemas), so make sure you're using Schema Registry minimum of 5.5.

If you need it, check the docker-compose I created with such schema registry here: https://github.com/codingharbour/kafka-docker-compose/tree/master/single-node-avro-kafka

mahfooziiitian commented 3 years ago

Thank you , yes after using schema registry 5.5.1, issue has been resolved.

Hi @mahfooz

schemaType field was introduced in version 5.5 of schema registry (together with support for Protobuf and Json schemas), so make sure you're using Schema Registry minimum of 5.5.

If you need it, check the docker-compose I created with such schema registry here: https://github.com/codingharbour/kafka-docker-compose/tree/master/single-node-avro-kafka

Thank you , yes after using schema registry 5.5.1, issue has been resolved.