Kafka Spark Streaming Example

Simple examle for Spark Streaming over Kafka topic
Alternatives To Kafka Spark Streaming Example
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Flink Learning13,198
24 days agoapache-2.0Java
flink learning blog. http://www.54tianzhisheng.cn/ 含 Flink 入门、概念、原理、实战、性能调优、源码解析等内容。涉及 Flink Connector、Metrics、Library、DataStream API、Table API & SQL 等内容的学习案例,还有 Flink 落地应用的大型项目案例(PVUV、日志存储、百亿数据实时去重、监控告警)分享。欢迎大家支持我的专栏《大数据实时计算引擎 Flink 实战与性能优化》
Redpanda6,35615 hours ago343April 25, 20211,242C++
Redpanda is a streaming data platform for developers. Kafka API compatible. 10x faster. No ZooKeeper. No JVM!
Ksql5,448
5 hours ago1,260otherJava
The database purpose-built for stream processing applications.
Materialize4,922
5 hours ago2August 12, 20221,853otherRust
Materialize is a fast, distributed SQL database built on streaming internals.
Jocko4,516
a year ago61mitGo
Kafka implemented in Golang with built-in coordination (No ZK dep, single binary install, Cloud Native)
Liftbridge2,4132a month ago67September 09, 202244apache-2.0Go
Lightweight, fault-tolerant message streams.
Examples1,693
11 days ago573July 07, 202296apache-2.0Shell
Apache Kafka and Confluent Platform examples and demos
Flink Streaming Platform Web1,550
5 days ago27mitJava
基于flink的实时流计算web平台
Killrweather1,174
6 years ago23apache-2.0Scala
KillrWeather is a reference application (work in progress) showing how to easily integrate streaming and batch data processing with Apache Spark Streaming, Apache Cassandra, Apache Kafka and Akka for fast, streaming computations on time series data in asynchronous event-driven environments.
Stream Reactor92214 days ago1December 27, 201877apache-2.0Scala
Streaming reference architecture for ETL with Kafka and Kafka-Connect. You can find more on http://lenses.io on how we provide a unified solution to manage your connectors, most advanced SQL engine for Kafka and Kafka Streams, cluster monitoring and alerting, and more.
Alternatives To Kafka Spark Streaming Example
Select To Compare


Alternative Project Comparisons
Readme

kafka · spark streaming example

Build Status

This is a simple dashboard example on Kafka and Spark Streaming

Prerequisites

Java 1.8 or newer version required because lambda expression used for few cases

  1. Java >= 1.8 (Oracle JDK has been tested)
  2. Maven >= 3
  3. Apache Spark >= 2.0.2
  4. Kafka >= 0.10.1.0

Installation

First of all, clone the git repository,

$ git clone [email protected]:trK54Ylmz/kafka-spark-streaming-example.git

after you need to use Maven for creating uber jar files,

$ mvn clean package -DskipTests

until that moment we had created jar files and now we'll install Kafka and MySQL,

$ wget http://www-us.apache.org/dist/kafka/0.10.1.0/kafka_2.11-0.10.1.0.tgz
$ # or wget http://www-eu.apache.org/dist/kafka/0.10.1.0/kafka_2.11-0.10.1.0.tgz
$ tar -xf kafka_2.11-0.10.1.0.tgz
$ cd kafka_2.11-0.10.1.0
$ nohup ./bin/zookeeper-server-start.sh ./config/zookeeper.properties > /tmp/kafka-zookeeper.out 2>&1 &
$ nohup ./bin/kafka-server-start.sh ./config/server.properties > /tmp/kafka-server.out 2>&1 &

Kafka is ready we can continue to install MySQL,

$ sudo apt-get install mysql-server # for Ubuntu, Debian
$ sudo yum install mysql-server && sudo systemctl start mysqld # for CentOS, RHEL
$ brew install mysql && mysql.server restart # for macOS

and finally create MySQL database and table,

CREATE DATABASE IF NOT EXISTS dashboard_test;

USE dashboard_test;

CREATE TABLE IF NOT EXISTS events (
 market VARCHAR(24) NOT NULL DEFAULT '',
 rate FLOAT DEFAULT NULL,
 dt DATETIME NOT NULL,
 PRIMARY KEY (market, dt)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

Usage

1 - Start the Spark streaming service and it'll process events from Kafka topic to MySQL,

$ cd kafka-spark-streaming-example
$ java -Dconfig=./config/common.conf -jar streaming/target/spark-streaming-0.1.jar

2 - Start the Kafka producer and it'll write events to Kafka topic,

$ java -Dconfig=./config/common.conf -jar producer/target/kafka-producer-0.1.jar

3 - Start the web server so you can see the dashboard

$ java -Dconfig=./config/common.conf -jar web/target/web-0.1.jar

4 - If everything look fine, please enter the dashboard address,

open http://localhost:8080 # default value : 8080

screen

Popular Kafka Projects
Popular Streaming Projects
Popular Data Processing Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Java
Mysql
Dashboard
Spark
Kafka
Streaming
Stream Processing
Spark Streaming