Skip to content

glorysongglory/springboot-kafka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

springboot-kafka

Spring Boot2.0 整合 Kafka

安装配置Kafka ,Zookeeper

在这里不再赘述,可参考Apache Kafka 安装步骤

执行测试类可查看效果

    @Test
    public void kafkaSend() throws InterruptedException {
        //模拟发消息
        for (int i = 0; i < 5; i++) {
            User user = new User();
            user.setId(System.currentTimeMillis());
            user.setMsg(UUID.randomUUID().toString());
            user.setSendTime(new Date());

            kafkaSender.send(user);
            Thread.sleep(3000);
        }
    }

参考资料

Spring Boot2.0 整合 Kafka

About

Spring Boot2.0 整合 Kafka

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages