Description
Use case
Currently, I have had multiple times that my messages were not received by clients. Upon investigation, I could not find any errors within my code. Eventually, I managed to find out that AppSync Events is rejecting some message because the total message size is bigger than 240Kb, by sending my lambda response directly within the AppSync Event console.
I use the EventSync Events handler. As the total size of the message is depending on a number of factors (for example JSON.stringify increased my integer array with a size * 2), it would be great to somehow detect a bigger than 240Kb message before returning the lambda handler. That way, I can remove nice-to-have properties or split up the messages into multiple parts.
Solution/User Experience
One idea would be to have a function calculateMessageSize
returning the total message size in Kb, so you can delete
properties.
Alternative solutions
Acknowledgment
- This feature request meets Powertools for AWS Lambda (TypeScript) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and .NET
Future readers
Please react with 👍 and your use case to help us understand customer demand.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status