{"id":17469644,"url":"https://github.com/mshick/librabbitmq","last_synced_at":"2025-09-20T21:32:43.337Z","repository":{"id":142589173,"uuid":"100820321","full_name":"mshick/librabbitmq","owner":"mshick","description":"Easy to use methods implementing common PubSub and task queue patterns with RabbitMQ.","archived":false,"fork":false,"pushed_at":"2018-07-13T14:40:41.000Z","size":118,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-30T20:45:52.273Z","etag":null,"topics":["amqp","pubsub","rabbitmq","task-queue"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mshick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-19T20:43:19.000Z","updated_at":"2019-05-10T09:17:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"f629e245-d591-4824-be95-e5459778ed1a","html_url":"https://github.com/mshick/librabbitmq","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mshick/librabbitmq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshick%2Flibrabbitmq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshick%2Flibrabbitmq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshick%2Flibrabbitmq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshick%2Flibrabbitmq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mshick","download_url":"https://codeload.github.com/mshick/librabbitmq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshick%2Flibrabbitmq/sbom","scorecard":{"id":665665,"data":{"date":"2025-08-11","repo":{"name":"github.com/mshick/librabbitmq","commit":"2080e294a46da8efa26fdb355e23caa6c3562f30"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"46 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-h726-x36v-rx45","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T17:56:55.224Z","repository_id":142589173,"created_at":"2025-08-21T17:56:55.225Z","updated_at":"2025-08-21T17:56:55.225Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276163323,"owners_count":25596014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amqp","pubsub","rabbitmq","task-queue"],"created_at":"2024-10-18T15:43:25.242Z","updated_at":"2025-09-20T21:32:43.036Z","avatar_url":"https://github.com/mshick.png","language":"JavaScript","readme":"librabbitmq [![Build Status](https://travis-ci.org/mshick/librabbitmq.svg?branch=master)](https://travis-ci.org/mshick/librabbitmq) [![npm version](https://badge.fury.io/js/librabbitmq.svg)](https://badge.fury.io/js/librabbitmq)\n============\n\nEasy to use methods implementing common PubSub and task queue patterns with RabbitMQ.\n\nConfiguration\n-------------\n\nThe plugin supports the following configuration (defaults shown):\n\n```js\nconst config = {\n  url: 'amqp://localhost',\n  preserveChannels: true,\n  connection: {\n    socket: {},\n    tuning: {},\n    retry: {\n      retries: 0,\n      factor: 2,\n      minTimeout: 1000,\n      maxTimeout: Infinity,\n      randomize: false\n    },\n    useExisting: false\n  },\n  retryQueue: {\n    suffix: '_retry',\n    maxCount: 10,\n    factor: 2,\n    minTimeout: 1 * 1000,\n    maxTimeout: 60 * 1000,\n    maxLength: 10000\n  },\n  doneQueue: {\n    suffix: '_done',\n    maxLength: 10000\n  }\n};\n```\n\n*   `connection.socket` options will be passed through to the underlying `amqp.connect`\n*   `connection.tuning` is an object that constructs the various RabbitMQ tuning query string params\n*   `connection.retry` affects the connection retry attempts using the underlying [retry](https://github.com/tim-kos/node-retry) module\n*   `connection.useExisting` will return an existing default connection upon invocation of `createConnection`, useful if you have many plugins but want to just use a single connection. Defaults to `false`.\n*   `preserveChannels` will keep around publish and push channels, minimizing request overhead, but potentially causing [issues](https://github.com/squaremo/amqp.node/issues/144), though none I've been able to replicate\n*   `retryQueue` settings for the retry queue, supporting limits and exponential backoff\n*   `doneQueue` can write finished tasks to a final queue. Defaults to `false`, because it seems like an odd pattern. You're probably better off writing to your own db.\n\nAdditionally, all of the exposed methods take options that get passed to the underlying `amqplib` calls.\n\nUsage\n-----\n\nGenerally speaking, you only need to create a connection once, and that will be reused for all of your channel creation. You do have the option of creating multiple connections and passing those to the methods that create channels, if you need greater control.\n\nBelow are the easiest examples.\n\n### PubSub\n\n```js\nimport * as rmq from 'librabbitmq';\n\nconst subscriber = function (message) {\n  return new Promise(() =\u003e {\n    console.log(' [x] Received \\'%s\\'', message.payload);\n  });\n};\n\nconst testIt = async function () {\n  await rmq.createConnection({\n    url: 'amqp://localhost'\n  });\n\n  await rmq.addSubscriber({\n    exchange: 'pubsub',\n    subscriber\n  });\n\n  return rmq.publishMessage({\n    exchange: 'pubsub',\n    topic: 'request',\n    payload: 'a message!'\n  });\n}\n\ntestIt();\n```\n\n### Task queue\n\n```js\nimport * as rmq from 'librabbitmq';\nconst {ACK} = rmq.constants;\n\nconst worker = function (task) {\n  const secs = 10;\n  console.log(' [x] Received payload id: %s', task.properties.correlationId);\n  console.log(' [x] Task takes %d seconds', secs);\n  return new Promise(resolve =\u003e {\n    setTimeout(() =\u003e {\n      console.log(' [x] Done');\n      console.log(task.payload);\n      resolve({code: ACK});\n    }, secs * 1000);\n  });\n};\n\nconst testIt = async function () {\n  await rmq.createConnection({\n    url: 'amqp://localhost'\n  });\n\n  await rmq.addWorker({\n    queue: 'work',\n    worker\n  });\n\n  return rmq.pushTask({\n    queue: 'work',\n    type: 'foo',\n    correlationId: '123'\n    payload: request.payload\n  });\n}\n\ntestIt();\n```\n\nRetry\n-----\n\nThis module implements a [retry queue with exponential backoff](https://felipeelias.github.io/rabbitmq/2016/02/22/rabbitmq-exponential-backoff.html) and is enabled by default for work queues. I've found this to be very useful in my projects, and is perhaps the best justification for using this library over amqplib directly.\n\nImplementations\n---------------\n\n* [hapi-rabbitmq](https://github.com/mshick/hapi-rabbitmq)\n\nRequirements\n------------\n\n*   node.js \u003e= 6.0\n*   RabbitMQ 3.6.11 (only version tested)\n\nTODO\n----\n\n*   Handle queue assertion failures\n*   Add real tests\n*   Add fanout pattern\n*   Add RPC pattern\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmshick%2Flibrabbitmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmshick%2Flibrabbitmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmshick%2Flibrabbitmq/lists"}