引入POM依赖
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
<version>2.5.0.RELEASE</version>
</dependency>
修改bootstrap配置文件
spring:
kafka:
bootstrap-servers: 192.168.20.135:9092 #kafka地址
producer:
retries: 3 #重试次数
consumer:
auto-offset-reset: latest #从最新的消息开始
zipkin:
sender:
type: kafka # 默认是 web
base-url: http://192.168.20.135:9411/
启动SpringBoot工程