Skip to content

Latest commit

 

History

76 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kafka demo

Coverage

sboot/kotlin reusable building blocks for kafka event-driven pipelines

  • clustering / replication / partitioning
  • Avro schema / registry
  • transactional outbox publish
  • idempotent transactional inbox consume
  • manual CDC
  • automatic CDC / outbox publish with Debezium
  • backoff / retry / rescue
  • dead lettering
  • GraalVM
  • mTLS / ACLs

overview

overview sequence UML

env

Kraft cluster

can be modified using compose.yaml and .env

components

kafka-demo/ # parent pom
├── commons/ # shared libs/abstractions, Avro schemas/codegen, test fixtures
├── order-api/
├── inventory-service/

order api sequence UML

inventory service sequence UML

run

docker compose pull && docker compose up

order-api | kafbat UI | jaeger | grafana

test

curl -iLX 'POST' \
  'http://localhost:8080/api/order' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"customerId":"user_2203","items":[{"sku":"sku-01","quantity":10,"unitPriceCents":199}]}'

load test

oha

oha -n 5000 -c 500 --redirect 0 \
  -m POST \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"customerId":"user_2203","items":[{"sku":"sku-01","quantity":10,"unitPriceCents":199}]}' \
  http://localhost:8080/api/order

# -n total request
# -c concurrent connection

expect n to land in orders.placed and around 50% of n to land in orders.[accepted|rejected] each

chaos test

pause or stop any Kafka container mid-load test, order-api | inventory-service | debezium/connect should recover automatically after 1st timeout

build

sdkman | nvm

nvm use && npm i && sdk env install

JVM

./gradlew clean ktlintFormat ktlintCheck build jibDockerBuild -x processAot -x processTestAot
docker compose -f compose.jvm.yaml up

GraalVM

./gradlew clean ktlintFormat ktlintCheck build -PgenerateMetadata
./gradlew buildImage
docker compose up

About

sboot/kotlin reusable building blocks for kafka event-driven pipelines

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages