From a50e48df204cf137cc5936fe08b044c9ffe39eaf Mon Sep 17 00:00:00 2001 From: "A. Ruiz" <40408539+maestre3d@users.noreply.github.com> Date: Sun, 30 Apr 2023 23:04:56 -0600 Subject: [PATCH] Fix SNS publish for non-default message types --- driver/amazon/sns/writer.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/driver/amazon/sns/writer.go b/driver/amazon/sns/writer.go index 4eab902..d74abb5 100644 --- a/driver/amazon/sns/writer.go +++ b/driver/amazon/sns/writer.go @@ -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