Skip to content

Commit

Permalink
do not publish message when no data
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinnoel-be committed Jan 21, 2025
1 parent 57e9516 commit 8cb1d09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions exporter/googlecloudpubsubexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ func (ex *pubsubExporter) shutdown(_ context.Context) error {
}

func (ex *pubsubExporter) publishMessage(ctx context.Context, encoding encoding, data []byte, watermark time.Time) error {
if len(data) == 0 {
return nil
}

id, err := ex.makeUUID()
if err != nil {
return err
Expand Down

0 comments on commit 8cb1d09

Please sign in to comment.