Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

PLarboulette/kafka-protobuf-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test Kafka Protobuf Events

Context

How to clone (really ?)

git clone git@github.com:PLarboulette/kafka-protobuf-events.git

How to use

  • Add protobuf schemas into the protobuf folder of each project (consumer and producer). Your file need an extension .proto and to be located in this folder. I think you can customize this but why ?
  • Use sbt protobufGenerate.
  • Your new model(s) will be available into {{messageName}}OuterClass.{{messageName : for example, I define a model Animal, so the model I use with Scala is AnimalOuterClass.Animal.
  • Launch the environment : docker-compose -f docker-compose.yml up
  • Run the consumer
  • Run the producer. You can change the name of the animal to see the difference between the records in the topic.

Some command lines

  • To see the available subjects in the Schema Registry, you can use : curl http://localhost:8081/subjects
  • To see the details about the schema, you can use curl http://localhost:8081/subjects/{{yourSchemaReturnedByThePreviousCall}}/versions/1 (change the version if you have made an evolution) You have a return like this :
{
    subject: "animal-topic-value",
    version: 1,
    id: 1,
    schemaType: "PROTOBUF",
    schema: "syntax = "proto3"; message Dog { int32 paws = 1; } message Bird { int32 wings = 1; } message Animal { string name = 1; int32 age = 2; oneof animal { .Dog dog = 3; .Bird bird = 4; } } "
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages