Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code changes to upgrade latest versions of kafka and confluent schema registry. #44

Conversation

jadireddi
Copy link
Contributor

Upgraded to latest kafka major version and latest confluent schema registry to use the code:
confluentinc/schema-registry#680
in the JerseySchemaRegistryClient.scala

@ovotech ovotech deleted a comment May 28, 2018
@jadireddi
Copy link
Contributor Author

Hi @filosganga ,
Made version update changes for Kafka and confluent schema registry, to use some of the features present in confluent schema registry:4.1.1 library. For exp: confluentinc/schema-registry#680 to register different aggregate event types with same topic name.
If you feel this PR add value, could you please review and merge the code changes.

@krish23
Copy link

krish23 commented May 28, 2018

@jadireddi any examples available

@filosganga
Copy link
Contributor

@jadireddi I believe that while the schema registry will support multiple types per topic. The confluent serializer doesn't yet do it out of the box? Is it a correct assumption?

@jadireddi
Copy link
Contributor Author

jadireddi commented May 29, 2018

sorry for last reply.. Edited.

@filosganga , You are right. With the new feature , registering multiple schema's under same subject, .
the confluent serializer doesn't yet do it out of the box. Above pull request is only for subject naming strategy.

For example :
`val schemaRegistryEndpoint = "http://localhost:8081"

val schemaRegisterProps: Map[String,String] = Map[String,String](
"key.subject.name.strategy" → "io.confluent.kafka.serializers.subject.TopicRecordNameStrategy",
"value.subject.name.strategy" → "io.confluent.kafka.serializers.subject.TopicRecordNameStrategy"
)
val schemaRegistryClientSettings = new SchemaRegistryClientSettings (schemaRegistryEndpoint, com.ovoenergy.kafka.serialization.avro.SchemaRegistryClientSettings.DefaultAuthentication, 12, 4 )

val schemaRegistryClient = JerseySchemaRegistryClient(schemaRegistryClientSettings)

val serializer = avroBinarySchemaIdSerializer[UserCreated](schemaRegistryClient, isKey = false, includesFormatByte = true,
props = schemaRegisterProps)`

Above example schemaRegisterProps takes care of naming strategy. For brief note, kindly refer:
https://www.confluent.io/blog/put-several-event-types-kafka-topic/

@filosganga filosganga merged commit f8787b3 into ovotech:master Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants