Skip to content

Instantly share code, notes, and snippets.

@appletreeat56
Created December 12, 2022 12:02
Show Gist options
  • Save appletreeat56/936524428611c8a9e3a8b4b8c9450353 to your computer and use it in GitHub Desktop.
Save appletreeat56/936524428611c8a9e3a8b4b8c9450353 to your computer and use it in GitHub Desktop.
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