aspecto-io / sns-sqs-big-payload

Amazon SNS/SQS client library that enables sending and receiving messages with payload larger than 256KiB via Amazon S3.
Apache License 2.0
50 stars 17 forks source link

Nothing returned for large data #57

Open Zonalds opened 1 year ago

Zonalds commented 1 year ago

Hi,

I noticed everything works fine accept when I send any data that uses S3 then I will get nothing page.

On handle message, I did:

handleMessage: async ({ payload }) => { console.log({ payload }) },

Payload would return undefined. This only happens when I send any data over 256KB and requires S3. When I check SQS messages and poll, I can see something like:

{"S3Payload":{"Id":"3eaff789-c556-4cbd-8381-acde38e2508a","Bucket":"sqs-event-payload","Key":"3eaff789-c556-4cbd-8381-acde38e2508a.json","Location":"https://event-payload.s3.amazonaws.com/3eaff789-c556-4cbd-8381-acde38e2508a.json"}}

I have getPayloadFromS3 set to true but it doesn't seem like the message is downloaded. Using transformMessageBody returns the raw message as saved on SQS. That is an S3Payload object containing Id, Bucket, Key and Location.

But on calling handleMessage, I get nothing. Any idea what I am doing wrong?