Skip to content

Commit cc7d590

Browse files
committed
chore: 카프카 설정 개발계에 맞게 변경
1 parent 7cda880 commit cc7d590

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

docker-compose.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,26 @@ services:
2828
DB_NAME: ${DB_NAME}
2929
DB_PASSWORD: ${DB_PASSWORD}
3030
SLACK_WEBHOOK_URL: ${SLACK_WEBHOOK_URL}
31-
restart: always # 컨테이너가 중단되었을 때 재시작 설정
31+
restart: always # 컨테이너가 중단되었을 때 재시작 설정
32+
33+
zookeeper:
34+
image: confluentinc/cp-zookeeper:latest
35+
container_name: zookeeper
36+
environment:
37+
ZOOKEEPER_CLIENT_PORT: 2181
38+
ports:
39+
- "2181:2181"
40+
41+
kafka:
42+
image: confluentinc/cp-kafka:latest
43+
container_name: kafka
44+
ports:
45+
- "9092:9092"
46+
environment:
47+
KAFKA_BROKER_ID: 1
48+
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
49+
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
50+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT
51+
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
52+
depends_on:
53+
- zookeeper

src/main/java/org/myteam/server/chat/config/KafkaConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
@Configuration
2323
public class KafkaConfig {
2424

25-
private static final String BOOTSTRAP_SERVERS = "localhost:9092";
25+
private static final String BOOTSTRAP_SERVERS = "kafka:9092";
2626
private static final String DEFAULT_GROUP_ID = "chat-group";
2727

2828
@Bean

0 commit comments

Comments
 (0)