I am trying to post a message to AWS SQS using the below code (all 3 cases failing) which includes both message attributes and message body. I see its getting passed as only message body all the time. Any suggestions on how to make it work?
export async function Sample() {
const testQueue = "url of queue";
//Case#1
let messageBody = `{"Href": <<Path to json file>>}`;
let attributes = { attribute1: { Type: "String", Value: "somevalue" }};
await sqs.sendMessage(testQueue, messageBody, attributes);
//Case#2
let sqsMessage = `{"MessageBody": { "Href": <<Path to json file>> }, "MessageAttributes": { "attribute1": { "Type": "String", "Value": "somevalue" }}}`;
await sqs.sendMessage(testQueue, sqsMessage);
//Case#3
let sqsMessage = `{MessageBody: { "Href": <<Path to json file>> }, MessageAttributes: { "attribute1": { "Type": "String", "Value": "somevalue" }}}`;
await sqs.sendMessage(testQueue, sqsMessage);
}