Skip to content

Commit

Permalink
feat: manualOffsetCommit is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Yankov committed Apr 9, 2024
1 parent 1b524c0 commit 0f39d96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/kafka-client/src/events/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class Events {
* @param {string} name Topic name
* @return {Topic} Topic
*/
topic(name: string, manualOffsetCommit: boolean): Promise<Topic> {
topic(name: string, manualOffsetCommit?: boolean): Promise<Topic> {
if (_.isNil(name)) {
throw new Error('missing argument name');
}
Expand All @@ -107,6 +107,6 @@ export class Events {
}
// topic() api called inside Local / Kafka class - which then
// invokes the actual topic constructor
return this.provider.topic(name, this.config, manualOffsetCommit);
return this.provider.topic(name, this.config, manualOffsetCommit || false);
}
}
2 changes: 0 additions & 2 deletions packages/kafka-client/src/events/provider/kafka/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,6 @@ export class Topic {
this.provider.logger.info('Consumer connection reset successfully');
}
});
} else {
this.commitOffset();
}
}

Expand Down

0 comments on commit 0f39d96

Please sign in to comment.