Skip to content

Commit

Permalink
Set fromBeginning to false by default (#2101)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher-Li authored Aug 16, 2024
1 parent 3d141bd commit 5644e38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion indexer/services/vulcan/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const configSchema = {
...redisConfigSchema,

BATCH_PROCESSING_ENABLED: parseBoolean({ default: true }),
PROCESS_FROM_BEGINNING: parseBoolean({ default: true }),
PROCESS_FROM_BEGINNING: parseBoolean({ default: false }),
KAFKA_BATCH_PROCESSING_COMMIT_FREQUENCY_MS: parseNumber({
default: 3_000,
}),
Expand Down
7 changes: 5 additions & 2 deletions indexer/services/vulcan/src/helpers/kafka/kafka-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ export async function connect(): Promise<void> {
await consumer.subscribe({
topic: KafkaTopics.TO_VULCAN,
// https://kafka.js.org/docs/consuming#a-name-from-beginning-a-frombeginning
// Need to set fromBeginning to true, so when vulcan restarts, it will consume all messages
// rather than ignoring the messages in queue that were produced before ender was started.
// fromBeginning is by default set to false, so vulcan will only consume messages produced
// after vulcan was started. This config should almost never matter, because by Vulcan should
// read from the last read offset. fromBeginning will only matter if the offset is lost.
// In the case where the offset is lost, Vulcan should read from head because in 60 seconds all
// short term messages will expire and we can resend stateful orders through bazooka to Vulcan.
fromBeginning: config.PROCESS_FROM_BEGINNING,
});

Expand Down

0 comments on commit 5644e38

Please sign in to comment.