Skip to content

Commit

Permalink
fix: output name as text when no event data is present
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed Feb 5, 2024
1 parent 5e464c7 commit adfe54c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions service/messages/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ func (f Format) convert(evt *pb.CloudEvent, subDescr string, mode FormatMode, tr
txt += fmt.Sprintf("%s\n\n", txtData)
}
}
attrName, attrNameFound := evt.Attributes["name"]
if txt == "" && attrNameFound {
txt = attrName.GetCeString()
}
txt += fmt.Sprintf("Subscription: %s\n\nsource: %s\n", subDescr, evt.Source)
var attrsTxt string
if attrs {
Expand Down

0 comments on commit adfe54c

Please sign in to comment.