前言
由于我们的新项目使用的是spring-boot,而又要同步新项目中建的数据到老的系统当中.原来已经有一部分的同步代码,使用的是kafka. 其实只是做数据的同步,我觉得选MQ没必要使用kafka.首先数据量不大,其实搞kafka又要搞集群,ZK.只是用做一些简单数据同步的话,有点大材小用.
没办法,咱只是个打工的,领导让搞就搞吧.刚开始的时候发现有一个spring-integration-kafka,描述中说是基于spring-kafka做了一次重写.但是我看了官方文档.实在是搞的有点头大.功能一直没实现.文档写的也不是很漂亮,也可能是刚起步,有很多的问题.我这里只能放弃了,使用了spring-kafka.
实现方法
pom.xml文件如下
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
org.linuxsogood.sync
linuxsogood-sync
1.0.0-SNAPSHOT
org.springframework.boot
spring-boot-starter-parent
1.4.0.RELEASE
1.8
3.3.1
1.2.4
3.3.6
4.1.1
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-jdbc
org.springframework.boot
spring-boot-starter-aop
org.springframework.boot
spring-boot-starter-freemarker
org.springframework.kafka
spring-kafka
1.1.0.RELEASE
junit
junit
4.12
test
org.assertj
assertj-core
3.5.2
org.hamcrest
hamcrest-all
1.3
test
org.mockito
mockito-all
1.9.5
test
org.springframework
spring-test
4.2.3.RELEASE
test
org.springframework.boot
spring-boot-starter-test
test
mysql
mysql-connector-java
com.microsoft.sqlserver
sqljdbc4
4.0.0
com.alibaba
druid
1.0.11
org.mybatis
mybatis
${mybatis.version}
org.mybatis
mybatis-spring
${mybatis.spring.version}
org.mybatis.generator
mybatis-generator-core
1.3.2
compile
true
com.github.pagehelper
pagehelper</