@backpack/amazon-sqs
️ 📨
Utilities for sending messages to Amazon SQS.
Installing
First, ensure you have set up Nexus as private registry needed to use Backpack.
Then, install the package using npm:
bash
npm install @backpack/amazon-sqs
Make sure to also install the following AWS SDK client:
bash
npm install @aws-sdk/client-sqs
SqsPublisher
Utility class to publish messages.
ts
import { SQSClient } from "@aws-sdk/client-sqs";
import { SqsPublisher } from "@backpack/amazon-sqs";
const client = new SQSClient();
const publisher = new SqsPublisher(client, "my-queue-url");
// sends the message as raw payload
await publisher.sendRaw("raw payload");
// sends the message as JSON payload
await publisher.sendJson({ foo: 'Foo' });