-
Notifications
You must be signed in to change notification settings - Fork 1
Fix sending large messages to SQS queue #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
When the size reaches 80% of the 200KB size for the message, executes the "onTimeout" function and returns the PROGRESS event.
9a97b88 to
5c9be86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few nits
src/common/event-size-monitor.ts
Outdated
| import { ErrorRecord } from '../types/common'; | ||
| import { EventData } from '../types/extraction'; | ||
|
|
||
| const MAX_EVENT_SIZE = 200_000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably it is a good practice to put the unit too, so MAX_EVENT_SIZE_BYTES? Or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct.
Fixed.
src/common/event-size-monitor.ts
Outdated
| import { EventData } from '../types/extraction'; | ||
|
|
||
| const MAX_EVENT_SIZE = 200_000; | ||
| const SIZE_LIMIT_THRESHOLD = Math.floor(MAX_EVENT_SIZE * 0.8); // 160_000 bytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EVENT_SIZE_THRESHOLD_BYTES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Description
This fix limits the max amount of bytes to be sent to SQS to be 200kB, which resolves the issue with the events being comitted to SQS and failing because they surpass the 250kB limit.
Connected Issues
Checklist
npm run testOR no tests needed.npm run test:backwards-compatibility.no-docswritten: no-docs