From 5d2a74e88a8c4a679ec33636db3fee7df135621b Mon Sep 17 00:00:00 2001 From: Brett Hoerner Date: Tue, 3 Oct 2023 06:53:50 -0600 Subject: [PATCH] chore(plugin-server): commitOffsetsForMessages -> storeOffsetsForMessages --- plugin-server/src/kafka/batch-consumer.ts | 4 ++-- plugin-server/src/kafka/consumer.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin-server/src/kafka/batch-consumer.ts b/plugin-server/src/kafka/batch-consumer.ts index 96f11942d87dc..0a4b8fa88cc37 100644 --- a/plugin-server/src/kafka/batch-consumer.ts +++ b/plugin-server/src/kafka/batch-consumer.ts @@ -4,12 +4,12 @@ import { exponentialBuckets, Gauge, Histogram } from 'prom-client' import { status } from '../utils/status' import { createAdminClient, ensureTopicExists } from './admin' import { - commitOffsetsForMessages, consumeMessages, countPartitionsPerTopic, createKafkaConsumer, disconnectConsumer, instrumentConsumerMetrics, + storeOffsetsForMessages, } from './consumer' export interface BatchConsumer { @@ -210,7 +210,7 @@ export const startBatchConsumer = async ({ messagesProcessed += messages.length if (autoCommit) { - commitOffsetsForMessages(messages, consumer) + storeOffsetsForMessages(messages, consumer) } } } catch (error) { diff --git a/plugin-server/src/kafka/consumer.ts b/plugin-server/src/kafka/consumer.ts index d370248455289..d05013aa7e6f0 100644 --- a/plugin-server/src/kafka/consumer.ts +++ b/plugin-server/src/kafka/consumer.ts @@ -203,7 +203,7 @@ export const findOffsetsToCommit = (messages: TopicPartitionOffset[]): TopicPart return highestOffsets } -export const commitOffsetsForMessages = (messages: Message[], consumer: RdKafkaConsumer) => { +export const storeOffsetsForMessages = (messages: Message[], consumer: RdKafkaConsumer) => { const topicPartitionOffsets = findOffsetsToCommit(messages).map((message) => { return { ...message,