Skip to content

wacai/spring-boot-starter-kafka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

依赖

mvn clean install
<dependency>
    <groupId>com.wacai</groupId>
    <artifactId>spring-boot-starter-kafka</artifactId>
    <version>${version}</version>
</dependency>

Kafka Producer Properties

  • bootstrap.servers 是必须要有的配置项, 值是 kafka 的 broker 地址列表, 更多属性参见官方文档
springboot.kafka.conf.props[bootstrap.servers]=10.0.0.1:9092,10.0.0.2:9092

# 发送回执
springboot.kafka.conf.props[acks]=1

# 重试
springboot.kafka.conf.props[retries]=3 
springboot.kafka.conf.props[retry.backoff.ms]=1000

# 元数据
springboot.kafka.conf.props[metadata.fetch.timeout.ms]=5000 # 设置短一点时间有利于尽快发现配置异常

springboot.kafka.conf.props[bootstrap.servers]的写法请参见Spring-Boot-Configuration-Binding

其余的配置参见 KafkaConfiguration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages