Skip to content

Commit

Permalink
Fix SNS publish for non-default message types
Browse files Browse the repository at this point in the history
  • Loading branch information
maestre3d committed May 1, 2023
1 parent df1e86d commit a50e48d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion driver/amazon/sns/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ func (w Writer) write(ctx context.Context, stream string, msgBatch []streams.Mes
isTopicFIFO := strings.HasSuffix(stream, ".fifo")
batchBuf := make([]types.PublishBatchRequestEntry, len(msgBatch))
for i, msg := range msgBatch {
msgStr := string(msg.Data)
msgJSON, err := jsoniter.Marshal(message{
Default: string(msg.Data),
Default: msgStr,
Email: msgStr,
EmailJSON: msgStr,
HTTP: msgStr,
HTTPS: msgStr,
SQS: msgStr,
})
if err != nil {
return err
Expand Down

0 comments on commit a50e48d

Please sign in to comment.