调整 writer kafka 相关的配置

This commit is contained in:
巴拉迪维 2021-09-10 13:19:46 +08:00 committed by 曾伟
parent 82a7de637d
commit 75cc4ac2c9
4 changed files with 11 additions and 20 deletions

View File

@ -16,8 +16,8 @@ xxl.job.executor.logpath=./logs/xxl-job/jobhandler
### xxl-job executor log-retention-days
xxl.job.executor.logretentiondays=30
kafka.consumer.servers=localhost:29092
kafka.consumer.group.id=0
kafka.consumer.servers=localhost:29092,localhost:39092
kafka.consumer.group.id=gitlink-notification-group
kafka.consumer.auto.offset.reset=earliest
kafka.consumer.enable.auto.commit=false
kafka.consumer.auto.commit.interval=100

View File

@ -12,7 +12,7 @@ XXL_JOB_ADMIN_VERSION=2.3.0
MYSQL_CONTAINER_NAME=gitlink_mysql
REDIS_CONTAINER_NAME=gitlink_redis
XXL_JOB_ADMIN_CONTAINER_NAME=gitlink_xxl_job_admin
ZOOKEEPER_CONTAINER_NAME=gitlink_zookeepr
ZOOKEEPER_CONTAINER_NAME=gitlink_zookeeper
KAFKA_CONTAINER_01_NAME=gitlink_kafka_01
KAFKA_CONTAINER_02_NAME=gitlink_kafka_02

View File

@ -58,6 +58,8 @@ services:
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
# volumes:
# - ${DOCKER_DATA_PATH}/zookeeper:/var/lib/zookeeper
ports:
- ${ZOOKEEPER_LOCAL_PORT}:2181
networks:
@ -72,10 +74,12 @@ services:
- zookeeper
ports:
- ${KAFKA_01_LOCAL_PORT}:29092
volumes:
- ${DOCKER_DATA_PATH}/${KAFKA_CONTAINER_01_NAME}:/var/lib/kafka
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:9092,PLAINTEXT_HOST://localhost:${KAFKA_01_LOCAL_PORT}
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
@ -91,10 +95,12 @@ services:
- zookeeper
ports:
- ${KAFKA_02_LOCAL_PORT}:39092
# volumes:
# - ${DOCKER_DATA_PATH}/${KAFKA_CONTAINER_02_NAME}:/var/lib/kafka
environment:
KAFKA_BROKER_ID: 2
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka2:9092,PLAINTEXT_HOST://localhost:39092
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka2:9092,PLAINTEXT_HOST://localhost:${KAFKA_02_LOCAL_PORT}
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1

View File

@ -21,21 +21,6 @@ spring:
key-serializer: org.apache.kafka.common.serialization.StringSerializer
#value的Serializer类实现类实现了接口org.apache.kafka.common.serialization.Serializer
value-serializer: org.apache.kafka.common.serialization.StringSerializer
#=============== consumer =======================
consumer:
#用于标识此使用者所属的使用者组的唯一字符串
group-id: test-consumer-group
#当Kafka中没有初始偏移量或者服务器上不再存在当前偏移量时该怎么办默认值为latest表示自动将偏移重置为最新的偏移量
#可选的值为latest, earliest, none
auto-offset-reset: earliest
#消费者的偏移量将在后台定期提交默认值为true
enable-auto-commit: true
#如果'enable-auto-commit'为true则消费者偏移自动提交给Kafka的频率以毫秒为单位默认值为5000。
auto-commit-interval: 100
#密钥的反序列化器类实现类实现了接口org.apache.kafka.common.serialization.Deserializer
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
#值的反序列化器类实现类实现了接口org.apache.kafka.common.serialization.Deserializer
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
datasource:
# 配置数据源类型