diff --git a/sqs/sqs.go b/sqs/sqs.go index cc71f3e862ebd2d2d5257345530048ff293fef90..e9fa2f6f3554f5011923d64c01d0912c4770c057 100644 --- a/sqs/sqs.go +++ b/sqs/sqs.go @@ -126,10 +126,12 @@ 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 len(jsonBytes) > 0 { + if len(jsonBytes) > 200000 { + headers[SQSMessageOnS3Key] = "true" id := uuid.New() filename := fmt.Sprintf("%v-%v", sqsType, id.String()) + logs.Info("SQS message too big, saving to S3 with filename = %s", filename) err := uploadMessageToS3(msgr.S3Session, msgr.S3BucketName, filename, jsonBytes) if err != nil {