Code Monkey home page Code Monkey logo

iot-streaming's Introduction

iot-streaming

IoT Streaming using Flink to connect Kafka and Cassandra, Elastic

  • Import in IntelliJ

    • IntelliJ:
      • Select “File” -> “Import Project”
      • Select root folder of your project
      • Select “Import project from external model”, select “Maven”
      • Leave default options and finish the import
  • How to run this project

  1. Using the kafka/Producer.java to simulate the IoT Data Producer

  2. You can choose to use kafka/Consumer.java to test the simple process of IoT data.

  3. You can also choose to use flink/Processor.java to process the IoT data by Flink, eventually store the data to Cassandra and Elastic.

  • Kafka 0.10

    • Maven dependency
           <dependency>
             <groupId>org.apache.kafka</groupId>
             <artifactId>kafka_2.11</artifactId>
             <version>0.10.2.0</version>
         </dependency>  
         
         <dependency>
             <groupId>org.apache.flink</groupId>
             <artifactId>flink-connector-kafka-0.10_2.11</artifactId>
             <version>1.2.0</version>
         </dependency>
    
    • Example Java code
         DataStream<String> stream = env.addSource(
                 new FlinkKafkaConsumer10<>("test", new SimpleStringSchema(), properties));
         return stream;
  • Flink & Cassandra

    • Maven dependency
         <dependency>
             <groupId>com.datastax.cassandra</groupId>
             <artifactId>cassandra-driver-core</artifactId>
             <version>3.1.2</version>
         </dependency>
    
         <dependency>
             <groupId>org.apache.flink</groupId>
             <artifactId>flink-connector-cassandra_2.11</artifactId>
             <version>1.2.0</version>
         </dependency>
    
  • Flink & Elasticsearch Connector

    • Maven dependency
         <dependency>
             <groupId>org.apache.flink</groupId>
             <artifactId>flink-connector-elasticsearch2_2.11</artifactId>
             <version>1.2.0</version>
         </dependency>
    

iot-streaming's People

Watchers

 avatar

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.