AWS SQS sending Queue using SDK for JavaScript (v3)

Suman Dev
Jun 22, 2023
import { SQSClient, SendMessageCommand } from "@aws-sdk/client-sqs";
const sqsClient = new SQSClient({ region: 'Your AWS Region' });

export const sendQueue = async () => {
try {
const params = {
MessageBody: JSON.stringify("your data"),
QueueUrl: 'Your AWS Queue url',
};

const sqsResult = await sqsClient.send(new SendMessageCommand(params));
return sqsResult
} catch (err) {
throw err;
}
}

For further reference , please look in to this AWS Docs

--

--