Skip to content

Commit

Permalink
Rmpmp-242: Updated error logs on DLT write to include dlt topic name (#…
Browse files Browse the repository at this point in the history
…10)

Rmpmp-242: Updated error logs on DLT write to include dlt topic name
  • Loading branch information
stewartboyd119 authored Sep 3, 2024
1 parent ecb642e commit 658363e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

This project adheres to Semantic Versioning.

## 1.0.1 (Sep 3, 2024)

1. Added dlt topic name in error logs on dlt write failure

## 1.0.0 (July 2024)

Initial release to public github.com
Expand Down
4 changes: 2 additions & 2 deletions workoption.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (d dltOption) apply(w *Work) {
// establish a writer to the DLT early, so when the time comes the write is fast
writer, err := w.kafkaProvider.Writer(ctx, d.dltConfig)
if err != nil {
w.logger.Errorw(ctx, "Failed to get writer for dlt", "error", err, "offset", message.Offset, "partition", message.Partition, "topic", message.Topic)
w.logger.Errorw(ctx, "Failed to get writer for dlt", "error", err, "offset", message.Offset, "partition", message.Partition, "source_topic", message.Topic, "dlt_topic", d.dltConfig.Topic)
return
}

Expand All @@ -136,7 +136,7 @@ func (d dltOption) apply(w *Work) {
}

if _, err := writer.WriteRaw(ctx, &message.Key, message.value); err != nil {
w.logger.Errorw(ctx, "Failed to forward to DLT", "error", err, "offset", message.Offset, "partition", message.Partition, "topic", message.Topic)
w.logger.Errorw(ctx, "Failed to forward to DLT", "error", err, "offset", message.Offset, "partition", message.Partition, "source_topic", message.Topic, "dlt_topic", d.dltConfig.Topic)
}
}
w.onDones = append(w.onDones, f)
Expand Down

0 comments on commit 658363e

Please sign in to comment.