Skip to content

gAmUssA/springboot-kafka-avro

Repository files navigation

Spring Kafka Avro

Spring Boot, spring-kafka and Confluent Schema Registry integration example

The playbook

You can find the most recent playbook doc here

Local and CCloud

Deploy app to PAS

link:kafka.json[role=include]
filename
./mvnw verify -DskipTests=true

cf create-user-provided-service cp -p kafka.json

cf push --no-start

cf bind-service spring-kafka-avro cp

cf start spring-kafka-avro

Kafka Streams example

The jar is containing two application - a webservice that produces data, and filtering processor (based on SpringCloud Streams and Kafka Streams). They use separate runners.

Test the app

test
curl -X POST -d 'name=vik&age=33' spring-kafka-avro-noisy-dingo-pq.apps.richmond.cf-app.com/user/publish

kafka-avro-console-consumer --bootstrap-server kafka.santamaria.cf-app.com:9092 --consumer.config kafka.properties --topic users --from-beginning --property schema.registry.url=http://schemaregistry.santamaria.cf-app.com/