Skip to content

arajski/kafka-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kafka playground

A repository created to quickly test different kafka concepts and see how they actually work.

Getting started

Spin up containers

docker-compose up

Download dependencies

go mod download

Run a consumer

go run cmd/consumer/consumer.go

Run a producer

go run cmd/producer/producer.go

Useful commands

Register a schema

curl -X POST -H "Content-Type: application/vnd.schemaregistry.v1+json" \
  --data '{"schema": "{\"type\": \"record\", \"namespace\": \"test\", \"name\": \"Test\", \"fields\": [{\"name\": \"id1\",\"type\": \"int\"}, {\"name\":\"name\", \"type\": \"string\"}]}"}' \
  http://localhost:8081/subjects/test/versions

Register a schema with specific version and id

curl -X POST -H "Content-Type: application/vnd.schemaregistry.v1+json" \
  --data '{"version": 5, "id":100, "schema": "{\"type\": \"record\", \"namespace\": \"test\", \"name\": \"Test\", \"fields\": [{\"name\":\"new\",\"type\":\"string\", \"default\":\"undefined\"},{\"name\": \"id\",\"type\": \"int\"}, {\"name\":\"newname\", \"type\": \"string\"}]}"}' \
  http://localhost:8081/subjects/test/versions

Change import mode of a subject

curl -X PUT -H "Content-Type: application/vnd.schemaregistry.v1+json" \
  --data '{"mode":"IMPORT"}' \
  http://localhost:8081/mode/test\?force\=true

About

An experimental space to test kafka concepts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages