项目作者: evan-wu

项目描述 :
Simeple utility to consumer message form kafka and save to database(mysql).
高级语言: Java
项目地址: git://github.com/evan-wu/kafka-log-ingestion.git
创建时间: 2017-08-14T13:52:51Z
项目社区:https://github.com/evan-wu/kafka-log-ingestion

开源协议:

下载


Simple utility to import message from kafka to database.

Configuration

config.properties:

  1. kafka.group.id = LOG-TO-MYSQL
  2. kafka.bootstrap.servers = localhost:9092
  3. kafka.auto.offset.reset = earliest
  4. log.topic.mappings = myLogTopic=test.log_table
  5. log.ingestion.class=com.tazhi.log.ingestion.jdbc.JdbcIngestion
  6. #
  7. jdbc.driverClass = com.mysql.jdbc.Driver
  8. jdbc.url = jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false
  9. jdbc.user = test
  10. jdbc.password = test1234

Any properties begins with ‘kafka.’ will be applied to the kafka consumer.

Build and Run

  1. maven clean install
  2. java -jar kafka-log-ingestion-1.0-SNAPSHOT.jar (in target folder)