Skip to content

Commit

Permalink
feat: kafka config 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jcy0308 committed Aug 28, 2024
1 parent 9589cad commit 21d0055
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/config/kafka/kafka.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@ export class KafkaProducer implements OnModuleInit, OnModuleDestroy {
constructor() {
this.kafka = new Kafka({
clientId: process.env.CLIENT_ID,
brokers: [process.env.KAFKA_CLIENT_BOOTSTRAP_SERVER],
brokers: [
"kafka-controller-0.kafka-controller-headless.kafka.svc.cluster.local:9092",
"kafka-controller-1.kafka-controller-headless.kafka.svc.cluster.local:9092",
"kafka-controller-2.kafka-controller-headless.kafka.svc.cluster.local:9092",
],
logLevel: logLevel.INFO,
retry: {
initialRetryTime: 100,
retries: 10,
multiplier: 2,
},
sasl: {
mechanism: "scram-sha-256",
username: "user1",
password: "EXQhgljABW",
},
});
this.producer = this.kafka.producer();
}
Expand Down

0 comments on commit 21d0055

Please sign in to comment.