Created
December 12, 2022 12:02
-
-
Save appletreeat56/936524428611c8a9e3a8b4b8c9450353 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const today = format(new Date(), "ddMMyyyyHHmmssSSS"); | |
const sqs = new SQS({ apiVersion: "2012-11-05" }); | |
let params: SQS.SendMessageRequest = { | |
MessageAttributes: { | |
attribute1: { | |
DataType: "String", | |
StringValue: "attrubute1", | |
}, | |
attribute2: { | |
DataType: "String", | |
StringValue: "attribute2", | |
}, | |
}, | |
MessageBody: `SQS request - ${today}`, | |
QueueUrl: queueUrl, | |
MessageGroupId: `${Math.floor(Math.random() * (10) + 1)}`, //This is where you can group message within a groupID | |
MessageDeduplicationId: `${messageId}.${today}`, | |
}; | |
await sqs.sendMessage(params).promise(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment