Skip to content

This repository showcases a sample implementation of temperature data analysis using Apache Flink, highlighting real-time stream processing capabilities for performing analytics and generating insights from sensor data.

License

Notifications You must be signed in to change notification settings

appuv/KafkaTemperatureAnalyticsFlink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kafka Temperature Analytics

Alternate approach to Kstreams using flink. The temperature status is calculated using predefined values. The key and value of the kafka is consumed and produced using custom serde.

CodeQL Java CI with Maven License GitHub top language

Architecture:

Architecture

Prerequisite

  1. Java 17
  2. Docker
  3. Confluent Kafka 6.2.0
  4. Maven
  5. Flink

Getting Started

To run the application, Build the maven project

mvn clean install  

Run the project

Submit the application to the flink cluster. The docker file with embedded flink cluster and kafka broker is provided in resources/docker. It can be started via

docker-compose up -d

Create dummy data by Datagen or by console producer as below

kafka-console-producer.bat --bootstrap-server localhost:9092 --topic flink_source --property "parse.key=true" --property "key.separator=|"
{"serial" : "1"}|{"serial":"1","owner":"appu","temp":"25","location":"earth"}  //normal
{"serial" : "1"}|{"serial":"1","owner":"appu","temp":"66","location":"earth"}  //hot
{"serial" : "1"}|{"serial":"1","owner":"appu","temp":"-4","location":"earth"} //cold
{"serial" : "1"}|{"serial":"1","owner":"appu","temp":"99","location":"earth"} //invalid

The output can be observed by consuming the destination topic

kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic flink_destination --property print.key=true

About

This repository showcases a sample implementation of temperature data analysis using Apache Flink, highlighting real-time stream processing capabilities for performing analytics and generating insights from sensor data.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages