Skip to content

Commit

Permalink
fix: local kafka config
Browse files Browse the repository at this point in the history
  • Loading branch information
Angular2Guy committed Aug 12, 2024
1 parent 6bca2cc commit e12ea61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions backend/src/main/resources/application-kafka.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kafka.server.name=${KAFKA_SERVER_NAME:kafkaapp}
spring.kafka.bootstrap-servers=192.168.49.2:9092
kafka.server.name=${KAFKA_SERVER_NAME:localhost}
spring.kafka.bootstrap-servers=localhost:9092
spring.kafka.producer.compression-type=gzip
spring.kafka.producer.transaction-id-prefix: tx-
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
Expand Down
9 changes: 7 additions & 2 deletions runKafka.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# network config for KRaft
docker network create app-tier --driver bridge
# Kafka with KRaft
docker run -d --name kafka-server \
docker run -d \
-p 9092:9092 \
--name kafka-server \
--hostname kafka-server \
--network app-tier \
-e KAFKA_CFG_NODE_ID=0 \
Expand All @@ -11,4 +13,7 @@ docker run -d --name kafka-server \
-e KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT \
-e KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka-server:9093 \
-e KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER \
bitnami/kafka:latest
bitnami/kafka:latest
# Start Kafka with KRaft
docker start kafka-server

0 comments on commit e12ea61

Please sign in to comment.