Unable to send message attributes with SQSClient.sendMessage() method in K6

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";

  let messageBody = `{"Href": <<Path to json file>>}`;
  let attributes = { attribute1: { Type: "String", Value: "somevalue" }};
  await sqs.sendMessage(testQueue, messageBody, attributes);

  let sqsMessage = `{"MessageBody": { "Href": <<Path to json file>> }, "MessageAttributes": { "attribute1": { "Type": "String", "Value": "somevalue" }}}`;
  await sqs.sendMessage(testQueue, sqsMessage);

  let sqsMessage = `{MessageBody: { "Href": <<Path to json file>> }, MessageAttributes: { "attribute1": { "Type": "String", "Value": "somevalue" }}}`;
  await sqs.sendMessage(testQueue, sqsMessage);

Hi @vigneshkumarnataraja

Welcome to the community forum :wave:

Based on the current documentation for the k6 AWS SQS client, it does not seem the API supports sending attributes.

In the first example, the attributes you pass are in the options object, which only supports messageDeduplicationId and messageGroupId. And my guess is that adding them to the body will add those to the message body, not the metadata attributes that AWS expects.

Could you open an issue under Issues · grafana/k6-jslib-aws · GitHub to track this request?