{"_id":"@d4h/sqs-consumer","_rev":"6-d3ab326ce15fb8f518c193ea7580c7cf","time":{"6.0.0":"2021-09-15T16:57:41.138Z","created":"2021-09-16T18:32:27.311Z","6.0.1":"2021-09-16T18:32:27.561Z","modified":"2022-07-04T10:43:06.423Z","6.0.2":"2022-03-03T22:35:56.590Z","6.0.3":"2022-07-04T10:43:06.337Z"},"name":"@d4h/sqs-consumer","dist-tags":{"latest":"6.0.3"},"versions":{"6.0.1":{"name":"@d4h/sqs-consumer","version":"6.0.1","description":"Build SQS-based Node applications without the boilerplate","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"npm run clean && tsc","watch":"tsc --watch","clean":"rm -fr dist/*","prepublish":"npm run build","pretest":"npm run build","test":"mocha --recursive --full-trace --exit","lint":"eslint . --ext .ts","lint:fix":"eslint . --fix","coverage":"nyc mocha && nyc report --reporter=html && nyc report --reporter=json-summary","lcov":"nyc mocha && nyc report --reporter=lcov","posttest":"npm run lint"},"repository":{"type":"git","url":"git+https://github.com/d4h/sqs-consumer.git"},"bugs":{"url":"https://github.com/d4h/sqs-consumer/issues"},"homepage":"https://github.com/d4h/sqs-consumer","keywords":["sqs","queue","consumer"],"license":"Apache-2.0","devDependencies":{"@aws-sdk/smithy-client":"^3.5.0","@types/chai":"^4.2.11","@types/debug":"^4.1.5","@types/mocha":"^7.0.2","@types/node":"^14.0.13","@types/sinon":"^9.0.4","@types/typescript":"^2.0.0","chai":"^4.2.0","codeclimate-test-reporter":"^0.5.1","eslint":"^7.2.0","eslint-config-iplayer-ts":"^2.0.0","mocha":"^8.0.1","nyc":"^15.1.0","p-event":"^4.2.0","sinon":"^9.0.2","ts-node":"^8.10.2","tslint-config-airbnb":"^5.11.2","tslint-microsoft-contrib":"^6.2.0","typescript":"^3.9.5"},"dependencies":{"debug":"^4.1.1"},"peerDependencies":{"@aws-sdk/client-sqs":"^3.5.0"},"nyc":{"include":["src/**/*.ts"],"extension":[".ts"],"require":["ts-node/register"],"sourceMap":true,"instrument":true},"eslintConfig":{"extends":"iplayer-ts","parserOptions":{"ecmaVersion":2017,"sourceType":"module"}},"mocha":{"spec":"test/**/**/*.ts","require":"ts-node/register"},"gitHead":"987eef771274b1a350b97b6c35649cdc0932f412","_id":"@d4h/sqs-consumer@6.0.1","_nodeVersion":"16.5.0","_npmVersion":"7.21.1","dist":{"integrity":"sha512-QYdb/YzGnTlKgHku2yHA7sXkk9EjSPXu0pcuBcAgoKFQCjejGPt0rnwpNREkHvNFo/+726Q0dtN0Krfbku+6fA==","shasum":"cd0ec4b70a0ab235ee4d7a95e82928a1dadddb74","tarball":"https://registry.npmjs.org/@d4h/sqs-consumer/-/sqs-consumer-6.0.1.tgz","fileCount":25,"unpackedSize":70492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQ427CRA9TVsSAnZWagAATUcP/1kxBRYvfaDQc6W3tnHv\ndlyrBWi/f3CgSXlwWosYa5X8H0vIwXL8mXRjmw7iIHMpEnFPaIkAby7A3dUI\nfRMLMNePrZBMW03QG4kr8zD2NqV/J2Ip6EwrwcbmkH0v4yGkryOaH+ssWUIS\n5qfD3fcYD5cQa/AMrOgUETf83FlB0ycNduhvpEfHinbU35F6ht1npUchrosj\nL4NQk1sFeRqa3chhxwUKDnsp03wsUKoPIhI9e0XOIkie4sfjtMNJR4FsgkOQ\neDMlOa/AklrcjD/axugsOQkuJSG23OVrBs6grnLTQTxfHzVjT8sHEP3M6VcC\nqStaJum2sa5eaZZ0BFQu6aBShgBLGremDXz+hWle/skidbc5IZadG0u7A/Kv\nw8BsnvMEsH4sbwFbtnFb1oyK+1omhaRJep2ZVH+uMK2SA45KlNtr4Sjlwye8\nzCj6LM1azsRMFDuiTs0AlMhAeg9I1zLpQsZiJkl62zY3K8k1jmH8b3OdnHMP\nmkqGDKeI3IzqCeTiJvzxJlncBwwqvrUQmkfzkJZlL4SdvNdoWbHkqbFkFN38\nUIRGNN9JGBME3WIhFwPzLkVDxyaKaEFauj9XaEJNhTr8MVeChSAGSJBOxtEM\nZyA7GWZy7+aT7za12qCXG8PLtgxqOZrWbLdjtOLw1EbUT0VoZn6+uqdJv3bb\nt1eP\r\n=Ajvd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBsBdv/Eeu6f/ld0hypWFzg61e37jmx23ILAs3snkOnAAiEA9iBKlqJq6/36/QYaTB4UAP7bxgsdSSDCIPvKliJ5In0="}]},"_npmUser":{"name":"hannesvdvreken","email":"vandevreken.hannes@gmail.com"},"directories":{},"maintainers":[{"name":"hannesvdvreken","email":"vandevreken.hannes@gmail.com"},{"name":"bhalash","email":"mark@bhalash.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sqs-consumer_6.0.1_1631817147354_0.7010344669946054"},"_hasShrinkwrap":false},"6.0.2":{"name":"@d4h/sqs-consumer","version":"6.0.2","description":"Build SQS-based Node applications without the boilerplate","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"npm run clean && tsc","watch":"tsc --watch","clean":"rm -fr dist/*","prepublishOnly":"npm run build","pretest":"npm run build","test":"mocha --recursive --full-trace --exit","lint":"eslint . --ext .ts","lint:fix":"eslint . --fix","coverage":"nyc mocha && nyc report --reporter=html && nyc report --reporter=json-summary","lcov":"nyc mocha && nyc report --reporter=lcov","posttest":"npm run lint"},"repository":{"type":"git","url":"git+https://github.com/hannesvdvreken/sqs-consumer.git"},"bugs":{"url":"https://github.com/hannesvdvreken/sqs-consumer/issues"},"homepage":"https://github.com/hannesvdvreken/sqs-consumer","keywords":["sqs","queue","consumer"],"license":"Apache-2.0","devDependencies":{"@aws-sdk/smithy-client":"^3.5.0","@types/chai":"^4.2.11","@types/debug":"^4.1.5","@types/mocha":"^7.0.2","@types/node":"^14.0.13","@types/sinon":"^9.0.4","@types/typescript":"^2.0.0","chai":"^4.2.0","codeclimate-test-reporter":"^0.5.1","eslint":"^7.2.0","eslint-config-iplayer-ts":"^2.0.0","mocha":"^8.0.1","nyc":"^15.1.0","p-event":"^4.2.0","sinon":"^9.0.2","ts-node":"^8.10.2","tslint-config-airbnb":"^5.11.2","tslint-microsoft-contrib":"^6.2.0","typescript":"^3.9.5"},"dependencies":{"debug":"^4.1.1"},"peerDependencies":{"@aws-sdk/client-sqs":"^3.5.0"},"nyc":{"include":["src/**/*.ts"],"extension":[".ts"],"require":["ts-node/register"],"sourceMap":true,"instrument":true},"eslintConfig":{"extends":"iplayer-ts","parserOptions":{"ecmaVersion":2017,"sourceType":"module"}},"mocha":{"spec":"test/**/**/*.ts","require":"ts-node/register"},"gitHead":"20c85fc2612ec3f80d5c4e3f6e09dcd9c26506ab","_id":"@d4h/sqs-consumer@6.0.2","_nodeVersion":"16.5.0","_npmVersion":"8.3.0","dist":{"integrity":"sha512-dz1ZsW1tcAmwwMj/m2MCBBwN649on4ZfNOwoFhjPmnaVA+ZXQ0XXphKZ6cFvBrKL8BXA8gVo1Q1kdPBuRkInUA==","shasum":"55bf0f92a7f1c14158092d489155f1ed8a4d62a0","tarball":"https://registry.npmjs.org/@d4h/sqs-consumer/-/sqs-consumer-6.0.2.tgz","fileCount":32,"unpackedSize":83227,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIULMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/AxAAlmV8MGWQkvX1/CxFekv2qUIU4iIaqvMkwcsM1Ywz97gzsrCy\r\n0j9R+u4fFBhrO5RxSHG+s5tF7jSYWdRkd+vcjl66IZ9mIBvAeNAey/cSe4uH\r\nAWaBt1PBNMKaykE6QuK6lKcI/D3gShX94p1nqGGaMQ3UUiz4xlFWAn9KKszx\r\nadLDzsPIf9ynIGweQdfrHKlZdsKf3uYTQLHrIt86okupJFgmeKJ9eG5N683C\r\n+fYMJLNEs7vpWWyE9Lc0VlFlK0u/s1K9bl68c8ZvhI+ByaJxu7vO774koE5N\r\n+vECG6Dinc+oWoEGWLbHzs9uUWVwN406pYHsIeko6mEi+gf9KYwPi2QyXk13\r\nvOtD3ubE/qSytPxHhh9hcJaYCMnUIggTisvC3kWNFH3zRrhVRulmlRVXH3qT\r\nLrse1nr24anb84FTLVT0ZoeFDqjP54pu8fVallhNugCIsibjhUA2SE9tqGgG\r\nX9VFmmMBtK4cFn0n3APqtNJnzAFAejoE84/WkATbGTjir5V/tnVkBvfrLUJS\r\n+NDsOnIDFDaoQRqBbJSU71vAz52P0F8rjbyxz1NgqGHlpwsqafxWTwrYxxdp\r\nv0KN0PXPoYBumFR0G6ZV9ME8Ecu035RFsTpMJ12cwjo/+5FoqNK67ixu9Y7E\r\nDHu8CofI4AkHABc5UKJVFqZ7agFcD/+hT+E=\r\n=d9HB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICprhspw6WvrAQWrLlQoSguIE2cqPjT0F9ixg8Rq8T7yAiEA0k3tOQuH/EqnLya0P94ASQSJZUZPEfHI35gi+/nYEE0="}]},"_npmUser":{"name":"hannesvdvreken","email":"vandevreken.hannes@gmail.com"},"directories":{},"maintainers":[{"name":"hannesvdvreken","email":"vandevreken.hannes@gmail.com"},{"name":"bhalash","email":"mark@bhalash.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sqs-consumer_6.0.2_1646346956340_0.37364927768054157"},"_hasShrinkwrap":false},"6.0.3":{"name":"@d4h/sqs-consumer","version":"6.0.3","description":"Build SQS-based Node applications without the boilerplate","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"npm run clean && tsc","watch":"tsc --watch","clean":"rm -fr dist/*","prepublishOnly":"npm run build","pretest":"npm run build","test":"mocha --recursive --full-trace --exit","lint":"eslint . --ext .ts","lint:fix":"eslint . --fix","coverage":"nyc mocha && nyc report --reporter=html && nyc report --reporter=json-summary","lcov":"nyc mocha && nyc report --reporter=lcov","posttest":"npm run lint"},"repository":{"type":"git","url":"git+https://github.com/d4h/sqs-consumer.git"},"bugs":{"url":"https://github.com/d4h/sqs-consumer/issues"},"homepage":"https://github.com/d4h/sqs-consumer","keywords":["sqs","queue","consumer"],"license":"Apache-2.0","devDependencies":{"@aws-sdk/smithy-client":"^3.5.0","@types/chai":"^4.2.11","@types/debug":"^4.1.5","@types/mocha":"^7.0.2","@types/node":"^14.0.13","@types/sinon":"^9.0.4","@types/typescript":"^2.0.0","chai":"^4.2.0","codeclimate-test-reporter":"^0.5.1","eslint":"^7.2.0","eslint-config-iplayer-ts":"^2.0.0","mocha":"^8.0.1","nyc":"^15.1.0","p-event":"^4.2.0","sinon":"^9.0.2","ts-node":"^8.10.2","tslint-config-airbnb":"^5.11.2","tslint-microsoft-contrib":"^6.2.0","typescript":"^3.9.5"},"dependencies":{"debug":"^4.1.1"},"peerDependencies":{"@aws-sdk/client-sqs":"^3.5.0"},"nyc":{"include":["src/**/*.ts"],"extension":[".ts"],"require":["ts-node/register"],"sourceMap":true,"instrument":true},"eslintConfig":{"extends":"iplayer-ts","parserOptions":{"ecmaVersion":2017,"sourceType":"module"}},"mocha":{"spec":"test/**/**/*.ts","require":"ts-node/register"},"gitHead":"dbcd9d9ef61b3124ec7062379c1f8db4a679f2d1","_id":"@d4h/sqs-consumer@6.0.3","_nodeVersion":"16.5.0","_npmVersion":"8.3.0","dist":{"integrity":"sha512-vWhrhKl6Hduo60wzOonPmEq6CqPYg3JZvHH5nXNYEzHMleWCVBjNZ8hNE8HHf5Y7Kp/AeGnS13ztWaNG/h3FxA==","shasum":"6a3c7b5f20196fb90be22d6d54af5057aaad8375","tarball":"https://registry.npmjs.org/@d4h/sqs-consumer/-/sqs-consumer-6.0.3.tgz","fileCount":32,"unpackedSize":83128,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDH7lYNJ89Vf9nIf+6Wqvc6/zGpfTm8wWjcuaMaQSuMvwIhANcdlt314zlD9D9Y1k6p3LdvtnUatvdym5X+kvNM76Xe"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiwsQ6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoJHA/8ChMEqCUoklSpa/VQxxHFDMkk2nxXDJO2Ag0pLnYMoWd0hq5P\r\nnxm5Cop8h0xA4LmWyDKackjUkz/bOCsyTnDDpM4o4MFdNMpXnsFi/mlwVn08\r\nDtTcZVHCiz6e6jsyrVjcVWhpvx6eUDMwxMZAzaMqJRlfdtm5BSmsGywx/mxA\r\nxeXc9KAG3QMeqoImH9FPRvFme4ic/3tPOYw0slw6u/FlNhn0u9ArvqK4TiqO\r\nlB71x1o0WTiPb06nlwR17BgfFxQh4LR/5SBaBycAmg+evSh6H9akglavaCU3\r\nM/qBlcAJc5sjYZ87CvuykA5WdRBkY4MteemNz5dHb98BHio8oIl36HyBgUx5\r\njW8xVZnRIiHa6yxthTCQ2iZqa65fP0If3NOJzS31n+wz9s8qQ2UnKlYxyrMc\r\nQH67zjglBjfyfPwh5rP8tm4NwbSbDlfvEXvksVbJUzoYOMjM/oYKIjcQl251\r\nx+oSm6OvGHqkbs9iTzEpq6ZIQoUSYNgGs5SoQ3ZbumfjFR/HiiYSROCERuzl\r\nw8FMEymF8e6dyghwcKYI4/N+gQEP6IBGhsaBfVK5PYYRp2TQjfR7E5vOiQms\r\nY1QVnInHJETjseuPqzFTHzxpZ8q0zx9bI2ccgjCCsih5vfUhWRDSZbdrVe8C\r\nvHO49BpvfCIwjY74CRzhRqJCanG6wdgChwk=\r\n=gsz+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hannesvdvreken","email":"vandevreken.hannes@gmail.com"},"directories":{},"maintainers":[{"name":"hannesvdvreken","email":"vandevreken.hannes@gmail.com"},{"name":"bhalash","email":"mark@bhalash.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sqs-consumer_6.0.3_1656931386166_0.42773892882187603"},"_hasShrinkwrap":false}},"maintainers":[{"name":"hannesvdvreken","email":"vandevreken.hannes@gmail.com"},{"name":"bhalash","email":"mark@bhalash.com"}],"description":"Build SQS-based Node applications without the boilerplate","homepage":"https://github.com/d4h/sqs-consumer","keywords":["sqs","queue","consumer"],"repository":{"type":"git","url":"git+https://github.com/d4h/sqs-consumer.git"},"bugs":{"url":"https://github.com/d4h/sqs-consumer/issues"},"license":"Apache-2.0","readme":"# sqs-consumer\n\n[![NPM downloads](https://img.shields.io/npm/dt/@d4h/sqs-consumer)](https://npmjs.org/package/@d4h/sqs-consumer)\n[![Build Status](https://travis-ci.org/d4h/sqs-consumer.svg)](https://travis-ci.org/d4h/sqs-consumer) \n[![Code Climate](https://codeclimate.com/github/d4h/sqs-consumer/badges/gpa.svg)](https://codeclimate.com/github/d4h/sqs-consumer) \n[![Test Coverage](https://codeclimate.com/github/d4h/sqs-consumer/badges/coverage.svg)](https://codeclimate.com/github/d4h/sqs-consumer)\n\nBuild SQS-based applications without the boilerplate. Just define an async function that handles the SQS message processing.\n\n## Installation\n\n```bash\nnpm add @d4h/sqs-consumer\n```\n\nNote: This library assumes you are using [AWS SDK v3](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sqs/index.html). If you are using v2, please install v5.5.0:\n\n```bash\nnpm add sqs-consumer@5.5.0\n```\n\n## Usage\n\n```js\nimport { Consumer } from '@d4h/sqs-consumer';\n\nconst app = Consumer.create({\n  queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name',\n  handleMessage: async (message) => {\n    // do some work with `message`\n  }\n});\n\napp.on('error', (err) => {\n  console.error(err.message);\n});\n\napp.on('processing_error', (err) => {\n  console.error(err.message);\n});\n\napp.start();\n```\n\n* The queue is polled continuously for messages using [long polling](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html).\n* Messages are deleted from the queue once the handler function has completed successfully.\n* Throwing an error (or returning a rejected promise) from the handler function will cause the message to be left on the queue. An [SQS redrive policy](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSDeadLetterQueue.html) can be used to move messages that cannot be processed to a dead letter queue.\n* By default messages are processed one at a time – a new message won't be received until the first one has been processed. To process messages in parallel, use the `batchSize` option [detailed below](#options).\n* If you need to add specific configuration options to the SQS client, you may pass an instantiated client to the Consumer constructor:\n```js\nimport { Consumer } from '@d4h/sqs-consumer';\nimport { SQSClient } from '@aws-sdk/client-sqs';\n\nconst app = Consumer.create({\n  queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name',\n  handleMessage: async (message) => {\n    // do some work with `message`\n  },\n  sqs: new SQSClient({\n    region: 'my-region',\n    requestHandler: MyCustomHttpHandler\n  })\n});\n\napp.on('error', (err) => {\n  console.error(err.message);\n});\n\napp.on('processing_error', (err) => {\n  console.error(err.message);\n});\n\napp.start();\n```\n\n### Credentials\n\nBy default the consumer will look for AWS credentials in the places [specified by the AWS SDK](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html#Setting_AWS_Credentials). The simplest option is to export your credentials as environment variables:\n\n```bash\nexport AWS_SECRET_ACCESS_KEY=...\nexport AWS_ACCESS_KEY_ID=...\n```\n\nIf you need to specify your credentials manually, you can use a pre-configured instance of the [SQS Client](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sqs/classes/sqsclient.html) client and chose from [a valid credentials provider](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/)\n\n\n```js\nimport { Consumer } from '@d4h/sqs-consumer';\nimport { SQSClient } from '@aws-sdk/client-sqs';\nimport { fromIni } from '@aws-sdk/credential-provider-ini';\n\nconst credentials = fromIni({\n  profile: 'my-profile'\n});\n\nconst region = 'my-region';\n\nconst app = Consumer.create({\n  queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name',\n  handleMessage: async (message) => {\n    // ...\n  },\n  sqs: new SQSClient({ region, credentials })\n});\n\napp.on('error', (err) => {\n  console.error(err.message);\n});\n\napp.on('processing_error', (err) => {\n  console.error(err.message);\n});\n\napp.on('timeout_error', (err) => {\n console.error(err.message);\n});\n\napp.start();\n```\n\n## API\n\n### `Consumer.create(options)`\n\nCreates a new SQS consumer.\n\n#### Options\n\n* `queueUrl` - _String_ - The SQS queue URL\n* `region` - _String_ - The AWS region (default `eu-west-1`)\n* `handleMessage` - _Function_ - An `async` function (or function that returns a `Promise`) to be called whenever a message is received. Receives an SQS message object as it's first argument.\n* `handleMessageBatch` - _Function_ - An `async` function (or function that returns a `Promise`) to be called whenever a batch of messages is received. Similar to `handleMessage` but will receive the list of messages, not each message individually. **If both are set, `handleMessageBatch` overrides `handleMessage`**.\n* `handleMessageTimeout` - _Number_ - Time in ms to wait for `handleMessage` to process a message before timing out. Emits `timeout_error` on timeout. By default, if `handleMessage` times out, the unprocessed message returns to the end of the queue.\n* `attributeNames` - _Array_ - List of queue attributes to retrieve (i.e. `['All', 'ApproximateFirstReceiveTimestamp', 'ApproximateReceiveCount']`).\n* `messageAttributeNames` - _Array_ - List of message attributes to retrieve (i.e. `['name', 'address']`).\n* `batchSize` - _Number_ - The number of messages to request from SQS when polling (default `1`). This cannot be higher than the AWS limit of 10.\n* `visibilityTimeout` - _Number_ - The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request.\n* `heartbeatInterval` - _Number_ - The interval (in seconds) between requests to extend the message visibility timeout. On each heartbeat the visibility is extended by adding `visibilityTimeout` to the number of seconds since the start of the handler function. This value must less than `visibilityTimeout`.\n* `terminateVisibilityTimeout` - _Boolean_ - If true, sets the message visibility timeout to 0 after a `processing_error` (defaults to `false`).\n* `waitTimeSeconds` - _Number_ - The duration (in seconds) for which the call will wait for a message to arrive in the queue before returning.\n* `authenticationErrorTimeout` - _Number_ - The duration (in milliseconds) to wait before retrying after an authentication error (defaults to `10000`).\n* `pollingWaitTimeMs` - _Number_ - The duration (in milliseconds) to wait before repolling the queue (defaults to `0`).\n* `sqs` - _Object_ - An optional [SQS Client](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sqs/classes/sqsclient.html) object to use if you need to configure the client manually\n\n### `consumer.start()`\n\nStart polling the queue for messages.\n\n### `consumer.stop()`\n\nStop polling the queue for messages.\n\n### `consumer.isRunning`  \n\nReturns the current polling state of the consumer: `true` if it is actively polling, `false` if it is not.\n\n### Events\n\nEach consumer is an [`EventEmitter`](http://nodejs.org/api/events.html) and emits the following events:\n\n|Event|Params|Description|\n|-----|------|-----------|\n|`error`|`err`, `[message]`|Fired when an error occurs interacting with the queue. If the error correlates to a message, that error is included in Params|\n|`processing_error`|`err`, `message`|Fired when an error occurs processing the message.|\n|`timeout_error`|`err`, `message`|Fired when `handleMessageTimeout` is supplied as an option and if `handleMessage` times out.|\n|`message_received`|`message`|Fired when a message is received.|\n|`message_processed`|`message`|Fired when a message is successfully processed and removed from the queue.|\n|`response_processed`|None|Fired after one batch of items (up to `batchSize`) has been successfully processed.|\n|`stopped`|None|Fired when the consumer finally stops its work.|\n|`empty`|None|Fired when the queue is empty (All messages have been consumed).|\n\n### AWS IAM Permissions\n\nConsumer will receive and delete messages from the SQS queue. Ensure `sqs:ReceiveMessage` and `sqs:DeleteMessage` access is granted on the queue being consumed.\n\n\n### Contributing \nSee contributing [guidelines](https://github.com/d4h/sqs-consumer/blob/master/.github/CONTRIBUTING.md).\n","readmeFilename":"README.md"}