Skip to content

ColadaFF/Kafka-Avro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apache Kafka And Avro Example.

This is a simple maven app that uses apache kafka clients and apache avro api libs in order to connect to a kafka instance, send serialized messages by the producer implementation and use the consumer api in order to get and deserialize that messages.

Both classes (Kafka.SimpleConsumer, Kafka.SimpleProducer) have a main method, so, in order to run the example, execute them as you need.

The Avro model is:

{
  "namespace": "Message",
  "type": "record",
  "name": "EventMessage",
  "fields": [
    {
      "name": "machine",
      "type": "string"
    },
    {
      "name": "id",
      "type": "string"
    },
    {
      "name": "date",
      "type": "string"
    },
    {
      "name": "status",
      "type": "string"
    },
    {
      "name": "building",
      "type": "string"
    }
  ]
}

And is compiled using the apache-avro-tools.jar

About

Java example of how to use Apache kafka and apache avro in a kafka consumer and a kafka producer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages