Skip to content
Snippets Groups Projects

Resolve "Upload large SQS messages to S3"

Merged Johan de Klerk requested to merge 24-upload-large-sqs-messages-to-s3 into main
1 file
+ 1
2
Compare changes
  • Side-by-side
  • Inline
  • 1e86cfd6
    #24: Correctly check message length · 1e86cfd6
    Johan de Klerk authored
+ 1
2
@@ -3,7 +3,6 @@ package sqs
/*Package sqs provides a simple interface to send messages to AWS SQS*/
import (
"encoding/binary"
"encoding/json"
"fmt"
"github.com/google/uuid"
@@ -127,7 +126,7 @@ func SendSQSMessage(msgr Messenger, objectToSend interface{}, currentRequestID *
// If bigger than 200 KB upload message to s3 and send s3 file name to sqs
// The sqs receiver should check the header to see if the message is in the body or on s3
if binary.Size(message) > 0 {
if len(jsonBytes) > 0 {
headers[SQSMessageOnS3Key] = "true"
id := uuid.New()
filename := fmt.Sprintf("%v-%v", sqsType, id.String())
Loading