Skip to content

Commit 965521c

Browse files
committed
Fixes undefined context within updating of consumer assignments.
1 parent b8eb8f6 commit 965521c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/microservices/client/client-kafka.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export class ClientKafka extends ClientProxy {
8383
}));
8484

8585
// set member assignments on join and rebalance
86-
this.consumer.on(this.consumer.events.GROUP_JOIN, this.updateConsumerAssignments);
86+
this.consumer.on(this.consumer.events.GROUP_JOIN, this.updateConsumerAssignments.bind(this));
8787

8888
// connect the producer and consumer
8989
await this.producer.connect();
@@ -95,7 +95,7 @@ export class ClientKafka extends ClientProxy {
9595
return this.producer;
9696
}
9797

98-
public updateConsumerAssignments(data: ConsumerGroupJoinEvent): void {
98+
private updateConsumerAssignments(data: ConsumerGroupJoinEvent): void {
9999
this.consumerAssignments = data.payload.memberAssignment;
100100
}
101101

0 commit comments

Comments
 (0)