Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bobgroup-go-utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgroup-go-utils
Commits
056ff023
Commit
056ff023
authored
3 years ago
by
Francé Wilke
Browse files
Options
Downloads
Patches
Plain Diff
Limit SQS messages to 200 KB
parent
2b0d58f7
Branches
Branches containing commit
Tags
v1.15.0
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sqs/sqs.go
+3
-1
3 additions, 1 deletion
sqs/sqs.go
with
3 additions
and
1 deletion
sqs/sqs.go
+
3
−
1
View file @
056ff023
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment