GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Paleozoic/storm_spring_boot_demo: 一个基于Spring Boot的Storm开发手脚架,开箱即用!集成读写Kafka、写Redis、写MySQL示例。

BranchesTags
Open more actions menu

Latest commit

 

History

21 Commits
21 Commits

Folders and files

NameName
Last commit message
Last commit date
img
img
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

不做相关开发挺久了,想不到大家都有Spring Boot整合Storm的需求。后续有时间我会重新封装一次,做一定的优化。欢迎先star或者watch关注。但是无相关时间日期,一切随缘~ 2018-12-06

storm_spring_boot_demo

依赖组件

  • Storm
  • MySQL
  • Redis Cluster
  • Kafka

word count table defination

CREATE USER 'test'@'%' IDENTIFIED BY 'test@123';
GRANT ALL PRIVILEGES ON test.* TO test@'%';
FLUSH  PRIVILEGES ; 

CREATE TABLE `word_count` (
  `targetDate` date NOT NULL,
  `word` varchar(255) COLLATE utf8_bin NOT NULL,
  `count` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`targetDate`,`word`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin

模拟功能

  • 模拟业务数据写入Kafka(生成句子写入Kafka)
  • KafkaSpout消费Kafka指定topic
  • 清洗数据(句子拆分为单词)
  • 实时统计(滑动窗口数据写入Redis)
  • 汇总统计(每天的单词计数根据日期归档至MySQL)
  • TopN(这个纯属娱乐,源码实现待研究)

PS

  • 如果Spring Boot的很多对象实现了序列化接口就好办多了
  • 该应用已经在集群和本地模式皆可运行。

BUG

测试发现写入Kafka的数据正确,但是KafkaSpout消费的时候,偶尔会出现少量的重复消息。 原因暂时不明。 检查了Bolt都进行了ACK,理论上是不会重发的。 待研究。

  • offset没提交,重复消费
  • 没有ACK,重复发送
  • 网络抖动/启动机制/or其他???
  • 最后定位原因是:bolt继承了BaseBasicBolt,ack失败后调用fail重发,但是缓存count却没有还原。不过最后还是只能At Least Once。

效果图

拓扑图:拓扑图 Kafka的模拟数据:Kafka的模拟数据 MySQL的归档数据(At Least Once):MySQL的归档数据 Redis的实时数据:Redis的实时数据

About

一个基于Spring Boot的Storm开发手脚架,开箱即用!集成读写Kafka、写Redis、写MySQL示例。

Resources

Readme
MIT license
Activity

Stars

59 stars

Watchers

13 watching

Forks

43 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.