Skip to content

Commit

Permalink
Log Kafka offset (#1089)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 authored Dec 18, 2024
1 parent aab8d1c commit 8681910
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions processes/consumer/configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package consumer

import (
"context"
"log/slog"
"sync"

"github.com/artie-labs/transfer/lib/artie"
Expand Down Expand Up @@ -45,6 +46,8 @@ func commitOffset(ctx context.Context, topic string, partitionsToOffset map[stri
if err := topicToConsumer.Get(topic).CommitMessages(ctx, *msg.KafkaMsg); err != nil {
return err
}

slog.Info("Successfully committed Kafka offset", slog.String("topic", topic), slog.Int("partition", msg.KafkaMsg.Partition), slog.Int64("offset", msg.KafkaMsg.Offset))
}

if msg.PubSub != nil {
Expand Down

0 comments on commit 8681910

Please sign in to comment.