
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@gasbuddy/configured-sqs-client
Advanced tools
A small wrapper around the AWS SQS sdk and sqs-consumer to allow configuration from confit. Unlike configured-rabbitmq-client, most queue configuration for SQS is done OUTSIDE of the infrastructure here (assumedly will be terraform or similar). So this module focuses on publishing and consuming messages, but with as similar an configuration specification as possible.
See the test directory for sample usage. To send a message, you must configure a logical queue, something like:
{
region: 'us-east-1',
queues: {
basic: 'basic_queue'
}
}
Now, you can publish to this queue using:
configuredSqsClient.publish(req, 'basic', { some: 'message' });
To receive this message, you would subscribe:
sqs.subscribe(context, 'basic', async (req, message, envelope) => {
// Do stuff, await stuff, throw errors, whatever
});
If your handler throws an error, the redrive policy of the queue takes over. However, if your handler marks that error with a property "deadLetter" that is either true or the name of another queue, the failed attempt will be published on the target queue (either the deadLetter property of the queue that was configured in your configured-sqs-client config, or the queue specified in the deadLetter error property).
Max message size allowed through SQS is 256kb. You can compress/deflate your message if you think it could go over that limit.
configuredSqsClient.publish(req, 'basic', { some: 'message' }, { compression: true });
The deflated message will automatically be inflated before delivering to a consumer
docker run -p 9324:9324 gasbuddy/sqs-mock:latest
npm run test
FAQs
A configuration driven SQS client
We found that @gasbuddy/configured-sqs-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.