{"id":46510,"library":"sqs-queue-parallel","title":"sqs-queue-parallel","description":"Sqs-queue-parallel is a Node.js library built on top of Amazon AWS SQS that provides concurrent and parallel message polling. It allows you to create multiple SQS queue watchers (concurrency) each capable of receiving multiple messages (maxNumberOfMessages). This configuration enables parallel processing of messages, e.g., 2 concurrent watchers each fetching up to 4 messages can handle up to 8 message events in parallel. The library is at version 0.1.6 (released via npm) and appears to be stable but with no recent updates. It differentiates from standard AWS SDK polling by offering built-in concurrency and event-driven message handling.","status":"active","version":"0.1.6","language":"javascript","source_language":"en","source_url":"https://github.com/bigluck/sqs-queue-parallel","tags":["javascript","sqs","queue","poll","amazon","aws"],"install":[{"cmd":"npm install sqs-queue-parallel","lang":"bash","label":"npm"},{"cmd":"yarn add sqs-queue-parallel","lang":"bash","label":"yarn"},{"cmd":"pnpm add sqs-queue-parallel","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required to interact with Amazon SQS. The library uses the AWS SDK for SQS operations.","package":"aws-sdk","optional":false}],"imports":[{"note":"The package is CommonJS-only; no ESM exports provided. Using ES6 import will fail.","wrong":"import SqsQueueParallel from 'sqs-queue-parallel';","symbol":"SqsQueueParallel","correct":"const SqsQueueParallel = require('sqs-queue-parallel');"},{"note":"Must use `new` keyword; the constructor is not a factory function.","wrong":"const queue = SqsQueueParallel({ name: 'my-queue' });","symbol":"SqsQueueParallel (constructor)","correct":"const queue = new SqsQueueParallel({ name: 'my-queue' });"},{"note":"client is a property, not a method.","wrong":"queue.client();","symbol":"client property","correct":"const client = queue.client;"}],"quickstart":{"code":"const SqsQueueParallel = require('sqs-queue-parallel');\n\nconst queue = new SqsQueueParallel({\n  name: 'my-queue',\n  region: process.env.AWS_REGION ?? 'us-east-1',\n  accessKeyId: process.env.AWS_ACCESS_KEY ?? '',\n  secretAccessKey: process.env.AWS_SECRET_KEY ?? '',\n  maxNumberOfMessages: 4,\n  concurrency: 2,\n  waitTimeSeconds: 20\n});\n\nqueue.on('message', function (e) {\n  console.log('Received message:', e.data.MessageId);\n  // Process message...\n  e.deleteMessage(function(err, data) {\n    if (err) console.error('Delete error:', err);\n    e.next();\n  });\n});\n\nqueue.on('error', function (err) {\n  console.error('Queue error:', err);\n});\n\n// Send a message\nqueue.sendMessage({ body: 'Hello!' }, function(err, data) {\n  if (err) console.error('Send error:', err);\n});","lang":"javascript","description":"Shows basic setup: create SqsQueueParallel instance with AWS credentials, listen for 'message' events, delete and advance to next message, and send a message."},"warnings":[{"fix":"Consider migrating to a more modern SQS library or use the AWS SDK v3 directly if you need latest features.","message":"The library uses the older AWS SDK v2 client (`aws-sdk` package) which is in maintenance mode and will be supplanted by SDK v3 (`@aws-sdk/client-sqs`).","severity":"deprecated","affected_versions":"<=0.1.6"},{"fix":"Always ensure `e.next()` is called exactly once per message event, even on error.","message":"You must call `e.next()` after processing each message to free the concurrency slot and allow new messages to be polled. Forgetting this will eventually stall the queue.","severity":"gotcha","affected_versions":"*"},{"fix":"Start with small values (e.g., concurrency=1, maxNumberOfMessages=1) and increase gradually while monitoring resource usage.","message":"The `maxNumberOfMessages` and `concurrency` settings multiply to give maximum concurrent messages. Setting high values can overwhelm your application if not tuned properly.","severity":"gotcha","affected_versions":"*"},{"fix":"Plan for process termination; or fork and kill subprocesses. There is no graceful shutdown API.","message":"The library does not expose a `stop` or `destroy` method; once created, the polling continues until the process ends. This can cause memory leaks in long-running applications.","severity":"gotcha","affected_versions":"*"},{"fix":"Consider using AWS SDK's default credential chain (e.g., environment variables, EC2 instance role) instead of hardcoding keys.","message":"AWS credential keys (`accessKeyId`, `secretAccessKey`, `region`) are passed directly in constructor. Modern best practice uses IAM roles or credential chains.","severity":"deprecated","affected_versions":"*"}],"env_vars":null,"search_vec":"'0.1.6':75 '2':52 '4':59 '8':65 'allow':28 'amazon':17,112 'appear':80 'aw':18,93,113 'built':13,99 'built-in':98 'capabl':38 'concurr':22,36,53,101 'configur':45 'creat':31 'differenti':90 'driven':105 'e.g':51 'enabl':46 'event':67,104 'event-driven':103 'fetch':56 'handl':62,107 'javascript':108 'librari':12,71 'maxnumberofmessag':43 'messag':25,42,50,60,66,106 'multipl':32,41 'node.js':11 'npm':78 'offer':97 'parallel':4,8,24,47,69 'poll':26,95,111 'process':48 'provid':21 'queue':3,7,34,110 'receiv':40 'recent':87 'releas':76 'sdk':94 'sqs':2,6,19,33,109 'sqs-queue-parallel':1,5 'stabl':83 'standard':92 'top':15 'updat':88 'version':74 'via':77 'watcher':35,54","created_at":"2026-06-07T13:00:16.930584+00:00","updated_at":"2026-06-07T13:00:16.930584+00:00","problems":[{"fix":"Use `new SqsQueueParallel({...})` instead of `SqsQueueParallel({...})`.","cause":"Forgetting `new` keyword when instantiating the queue.","error":"TypeError: SqsQueueParallel is not a constructor"},{"fix":"Provide a `name` property in the options object: `{ name: 'my-queue' }`.","cause":"The `name` option is missing when creating the SqsQueueParallel instance.","error":"Error: Name is required"},{"fix":"Check that `e.data` exists and contains the expected properties; see AWS SDK ReceiveMessageResult structure.","cause":"Attempting to access message data before the 'message' event fires with valid data, or using `e.data.MessageId` but `e.data` is undefined.","error":"Uncaught TypeError: Cannot read property 'MessageId' of undefined"},{"fix":"Verify the region is correct and the host has outbound internet access. Check firewall settings.","cause":"Network issue or incorrect AWS region/endpoint causing connection timeout.","error":"Error: connect ETIMEDOUT ...:443"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/bigluck/sqs-queue-parallel","github":"https://github.com/bigluck/sqs-queue-parallel","docs":null,"changelog":null,"pypi":null,"npm":"sqs-queue-parallel","openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}