-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add support for attributes and delay seconds for SQS #65
Conversation
Hi, await sqs.sendMessage(testQueue, JSON.stringify({ value: '123' }), { ERRO[0001] Uncaught (in promise) SQSServiceError: The type of message (user) attribute 'my-attribute' is invalid. You must use only the following supported type prefixes: Binary, Number, String. |
Ah yes, mixed up the value attribute with the |
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.
LGTM 👍🏻 🙇🏻
Left a request for a comment, to make the code easier to maintain, but great job overall and thank you so much for your contribution.
Once the other issue raised is addressed, I'll happily approve and merge this 🙇🏻
@@ -64,6 +64,22 @@ export class SQSClient extends AWSClient { | |||
body = { ...body, MessageGroupId: options.messageGroupId } | |||
} | |||
|
|||
if (typeof options.messageAttributes !== 'undefined') { | |||
const attributeParameters = Object.entries(options.messageAttributes).reduce((params, [name, attribute], i) => { |
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.
This specific code would deserve some comment explaining what's going on. I had to read the docs and execute and log the code to figure it out myself: based on the attributes type, we match it to a specific object shape with the value field being different for each 😄 🙇🏻
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.
Done!
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.
@nickcaballero It worked now. Thanks for your help.
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.
Merci 🙇🏻
Adds support for sending SQS attributes and setting the delay seconds.