You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
Hi, AWS Lambda makes all the keys in the object lowercase, and your Consumer class for example is trying to do something like message.Body however this is undefined, because the key Body is actually body, therefore an error Invalid JSON at position 0 character 'u' is thrown.
I think you cannot change it to 'body' directly since the implementation works otherwise in environment outside Lambda, what I would suggest is to pass a key like integration: 'lambda' when an instance of the class is created and then you know if your class is being used in the context of lambda i.e lowercase record (event) keys.
The text was updated successfully, but these errors were encountered:
@arditshala how did you manage to get the error message from the EventEmitter into cloudwatch? I only managed to get the error message by adding a console.log in the catch clause in the sqs-consumer file at line 128
Hi, AWS Lambda makes all the keys in the object lowercase, and your Consumer class for example is trying to do something like
message.Body
however this is undefined, because the keyBody
is actuallybody
, therefore an errorInvalid JSON at position 0 character 'u'
is thrown.I think you cannot change it to 'body' directly since the implementation works otherwise in environment outside Lambda, what I would suggest is to pass a key like
integration: 'lambda'
when an instance of the class is created and then you know if your class is being used in the context of lambda i.e lowercase record (event) keys.The text was updated successfully, but these errors were encountered: