Skip to content

Commit

Permalink
fix: offset subscription for ACS during startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun-KumarH committed Mar 22, 2024
1 parent f4555b9 commit 00b3aa0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,10 @@ export class Worker {
const topicCfg = kafkaConfig.topics[topicLabel];
const topic = await events.topic(topicCfg.topic);
const offSetValue = await this.offsetStore.getOffset(topicCfg.topic);
logger.info('subscribing to topic with offset value', topicCfg.topic, offSetValue);
if (topicCfg.events) {
for (let eventName of topicCfg.events) {
await topic.on(eventName, eventListener);
await topic.on(eventName, eventListener, { startingOffset: offSetValue });
}
}
}
Expand Down

0 comments on commit 00b3aa0

Please sign in to comment.