-
Define a .proto file
-
Generate Code using below command:
protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/gogo/protobuf/protobuf --gogofast_out=. --gogofast_opt=paths=source_relative your_file.proto
-
Attach schema to the topic
-
Generate a JSON string of your schema.
-
Define schema definition in a json file. See example schema definition below:
{ "type": "PROTOBUF", "schema": "{\"fields\":[{\"default\":\"\",\"name\":\"name\",\"type\":\"string\"},{\"default\":0,\"name\":\"age\",\"type\":\"int\"}],\"name\":\"Person\",\"namespace\":\"person\",\"type\":\"record\"}", "properties": {} }
-
Upload schema to the pulsar topic
pulsar-admin schemas upload --filename < schemafile > < topicname >
-
-
Use Generated types while creating producer/consumer. See producer/producer_test.go for examples.
-
Notifications
You must be signed in to change notification settings - Fork 0
goku321/pulsar-proto-x
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Experiments with pulsar go client and protobuf
Resources
Stars
Watchers
Forks
Releases
No releases published