添加kafka的配置文件demo
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# Spring 配置
|
||||
spring:
|
||||
# Kafka配置
|
||||
kafka:
|
||||
# 指定Kafka集群的地址
|
||||
bootstrap-servers: ${KAFKA_HOST:127.0.0.1}:${KAFKA_PORT:9092}
|
||||
consumer:
|
||||
# 消费者组ID,用于消费者负载均衡和偏移量管理
|
||||
group-id: ${KAFKA_GROUP_ID:xtools}
|
||||
# 当没有初始偏移量或偏移量丢失时,earliest:从最早的消息开始消费,latest:从最新的消息开始消费
|
||||
auto-offset-reset: ${KAFKA_AUTO_OFFSET_RESET:latest}
|
||||
|
||||
xtools:
|
||||
kafka:
|
||||
# 分区数
|
||||
partitions: ${KAFKA_PARTITIONS:1}
|
||||
# 副本数
|
||||
replicaCount: ${KAFKA_REPLICA_COUNT:1}
|
||||
# 消息保留时长
|
||||
retentionMs: ${KAFKA_RETENTION_MS:604800000}
|
||||
@@ -17,6 +17,7 @@ spring:
|
||||
- boot-log
|
||||
- boot-mybatis-plus
|
||||
- boot-rabbitmq
|
||||
# - boot-kafka
|
||||
- boot-redis
|
||||
- boot-xxl-job
|
||||
- boot-storage
|
||||
|
||||
Reference in New Issue
Block a user