From e12ea612c83e5f4378edd1ac12bafe1b38a1963d Mon Sep 17 00:00:00 2001 From: Angular2guy Date: Mon, 12 Aug 2024 21:49:32 +0200 Subject: [PATCH] fix: local kafka config --- backend/src/main/resources/application-kafka.properties | 4 ++-- runKafka.sh | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/backend/src/main/resources/application-kafka.properties b/backend/src/main/resources/application-kafka.properties index afc8b6d..d0a7239 100644 --- a/backend/src/main/resources/application-kafka.properties +++ b/backend/src/main/resources/application-kafka.properties @@ -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 diff --git a/runKafka.sh b/runKafka.sh index 095d46b..13a0b41 100644 --- a/runKafka.sh +++ b/runKafka.sh @@ -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 \ @@ -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 \ No newline at end of file + bitnami/kafka:latest +# Start Kafka with KRaft +docker start kafka-server + \ No newline at end of file