Skip to content

Commit

Permalink
fix: broker 전부 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jcy0308 committed Aug 29, 2024
1 parent 44fbadf commit 077ffad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/kafka/kafka.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ export class KafkaService implements OnApplicationBootstrap, OnModuleDestroy {
) {
this.kafka = new Kafka({
clientId: `${process.env.CONSUMER_GROUP}+${process.pid}`,
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',
],
sasl: {
// mechanism: `process.env.SASL_MECHANISM`,
mechanism: 'scram-sha-256',
Expand Down Expand Up @@ -70,6 +74,7 @@ export class KafkaService implements OnApplicationBootstrap, OnModuleDestroy {
},
})
.catch((e) => console.error(`[example/consumer] ${e.message}`, e));
console.log('consumer has started');
}

async onModuleDestroy() {
Expand Down

0 comments on commit 077ffad

Please sign in to comment.