Giter Site home page Giter Site logo

fusillicode / avro4s-schema-registry-kafka-streams-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from casperkoning/avro4s-schema-registry-kafka-streams-demo

0.0 2.0 0.0 6 KB

Demo application for Avro4s/Schema Registry/Kafka Streams integration

Scala 100.00%

avro4s-schema-registry-kafka-streams-demo's Introduction

Integrating Kafka Streams, Confluent Schema Registry, and Avro4s

This is an example project that demos that it is possible to integrate Kafka Streams, Confluent Schema Registry, and Avro4s.

We have a simple Kafka Streams application, for which serialization to Kafka will be done by the KafkaAvroDeserializer and KafkaAvroSerializer, which leverage the schema validation in Confluent Schema Registry. We use Avro4s to easily add Avro support to our Scala case classes.

Dependencies

During this demo, we assume that an installation of Confluent Platform is installed in $CONFLUENT_HOME

Setup

  • Start up Zookeeper
$CONFLUENT_HOME/bin/zookeeper-server-start $CONFLUENT_HOME/etc/kafka/zookeeper-properties
  • Start up Kafka
$CONFLUENT_HOME/bin/kafka-server-start $CONFLUENT_HOME/etc/kafka/server.properties
  • Start up Schema Registry
$CONFLUENT_HOME/bin/schema-registry-start $CONFLUENT_HOME/etc/schema-registry/schema-registry.properties
  • Boot Writer application
  • Start up ordinary console-producer and produce on input topic, and publish some messages in the key;value format
$CONFLUENT_HOME/bin/kafka-console-producer --topic values --broker-list localhost:9092 --property "parse.key=true" --property "key.separator=;"
 
key;value 
  • Use avro-console-consumer to consume from output topic
$CONFLUENT_HOME/bin/kafka-avro-console-consumer --topic avro-values --from-beginning --zookeeper localhost:2181
  • Note that the schemas have been registered at Schema Registry
curl localhost:8081/subjects/
  • Boot Reader application
  • Start up ordinary console-consumer to consume from second output topic
$CONFLUENT_HOME/bin/kafka-console-consumer --topic upper-case-values

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.