{"id":21222214,"url":"https://github.com/lostintime/node-multiconsumer-bull","last_synced_at":"2025-07-02T08:05:56.048Z","repository":{"id":57305176,"uuid":"113348230","full_name":"lostintime/node-multiconsumer-bull","owner":"lostintime","description":"A multi-consumer queue on top of Bull queue","archived":false,"fork":false,"pushed_at":"2018-02-21T17:41:08.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T17:14:11.178Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lostintime.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}},"created_at":"2017-12-06T17:41:03.000Z","updated_at":"2017-12-06T17:41:32.000Z","dependencies_parsed_at":"2022-08-27T02:15:40.395Z","dependency_job_id":null,"html_url":"https://github.com/lostintime/node-multiconsumer-bull","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostintime%2Fnode-multiconsumer-bull","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostintime%2Fnode-multiconsumer-bull/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostintime%2Fnode-multiconsumer-bull/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostintime%2Fnode-multiconsumer-bull/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lostintime","download_url":"https://codeload.github.com/lostintime/node-multiconsumer-bull/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243668234,"owners_count":20328042,"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","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":[],"created_at":"2024-11-20T22:42:11.132Z","updated_at":"2025-03-15T01:16:39.916Z","avatar_url":"https://github.com/lostintime.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"MultiConsumer Bull\n===================\n\nA [multi-consumer queue](https://www.npmjs.com/package/multiconsumer-queue) implementation using [Bull](https://www.npmjs.com/package/bull) queue.\n\n\n## Installation\n\n```\nnpm install --save multiconsumer-bull\n```\n\n## Usage examples\n\n```typescript\nimport * as Bull from \"bull\"\nimport * as redis from \"redis\"\nimport {MultiConsumerBull} from \"multiconsumer-bull\"\n\nconst bus = MultiConsumerBull(new Bull(\"redis://127.0.0.1:6379\"), () =\u003e redis.createClient())\n\n// Process \"my-topic\" for logging\nbus.topic(\"my-topic\").process(\"log\", (job, cb) =\u003e {\n  console.log(\"got new job in topic \\\"my-topic\\\" with data\", job.data)\n  cb()\n})\n\n// Save all \"my-topic\" messages to database\nbus.topic(\"my-topic\").process(\"save\", (job, cb) =\u003e {\n  console.log(\"here we're going to save all messages from \\\"my-topic\\\" to database\", job.data)\n  cb()\n})\n\nbus.topic(\"my-topic\").add(\"Hello World!\")\n```\n\nNOTE: Wrapper implementation is not removing consumer groups from `RedisLiveSet` so once you're\n not interested anymore for processing topic messages for specific `groupId` -\n you must remove that group and tasks manually\n\nGroup can be removed using `MultiConsumerQueueImpl.removeGroup()` method:\n\n```typescript\n\nconst bus = MultiConsumerBull(...)\n\n// deploy this to your servers to stop collecting tasks\nbus.topic(\"my-topic\").removeGroup(\"old-process-group\")\n\n```\n\nYou will still have to manually remove tasks already added for that group, or maybe those may expire, \nthis depends on how source `NamedQueue` is implemented.\n\n\n## Contribute\n\n\u003e Perfection is Achieved Not When There Is Nothing More to Add, \n\u003e But When There Is Nothing Left to Take Away\n\nFork, Contribute, Push, Create pull request, Thanks. \n\n\n## License\n\nAll code in this repository is licensed under the Apache License, Version 2.0. See [LICENCE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostintime%2Fnode-multiconsumer-bull","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flostintime%2Fnode-multiconsumer-bull","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostintime%2Fnode-multiconsumer-bull/lists"}