Skip to content

hdulay/schema-registry-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo

Simple schema registry demo that uses Confluent Cloud schema registry.

Variables

Set these variables before executing the commands below.

export ENV=your_confluent_env
export CID=your_confluent_cluster_id
export TOKEN=your_security_token
export SECRET=your_security_secret
export SR=http://you-sr

Commands

ccloud login
ccloud environment use $ENV

ccloud schema-registry subject list

ccloud schema-registry schema describe --subject users-value --version latest

Create a topic

ccloud kafka topic create --cluster $CID transactions-avro

ccloud kafka topic create --cluster $CID transactions-proto

Create schema

ccloud schema-registry schema create \
    --subject transactions-value \
    --schema avro/src/main/resources/avro/io/confluent/examples/clients/basicavro/Payment.avsc \
    --type AVRO

ccloud schema-registry schema create \
    --subject transactions-proto-value \
    --schema person.proto \
    --type PROTOBUF

Create v2 schema

# Fails
ccloud schema-registry schema create --subject transactions-value --schema Payment2a.avsc --type AVRO
# Succeeds
ccloud schema-registry schema create --subject transactions-value --schema Payment2b.avsc --type AVRO
# Diff using vscode
code --diff avro/src/main/resources/avro/io/confluent/examples/clients/basicavro/Payment2a.avsc avro/src/main/resources/avro/io/confluent/examples/clients/basicavro/Payment2b.avsc

Using CURL

curl --user $TOKEN:$SECRET $SR/subjects

About

simple demo on how to use schema resgistry

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published