{"id":15322766,"url":"https://github.com/msfidelis/rsmq-promise","last_synced_at":"2025-04-15T02:37:25.039Z","repository":{"id":47682336,"uuid":"106548053","full_name":"msfidelis/rsmq-promise","owner":"msfidelis","description":"Promise interface for RSMQ","archived":false,"fork":false,"pushed_at":"2021-08-18T10:21:12.000Z","size":20,"stargazers_count":28,"open_issues_count":3,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T14:22:28.946Z","etag":null,"topics":["queue","redis","rsmq","worker"],"latest_commit_sha":null,"homepage":" https://github.com/smrchy/rsmq","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/msfidelis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-11T11:56:38.000Z","updated_at":"2022-04-10T06:28:41.000Z","dependencies_parsed_at":"2022-09-23T16:11:47.255Z","dependency_job_id":null,"html_url":"https://github.com/msfidelis/rsmq-promise","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msfidelis%2Frsmq-promise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msfidelis%2Frsmq-promise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msfidelis%2Frsmq-promise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msfidelis%2Frsmq-promise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msfidelis","download_url":"https://codeload.github.com/msfidelis/rsmq-promise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248995106,"owners_count":21195497,"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":["queue","redis","rsmq","worker"],"created_at":"2024-10-01T09:17:51.028Z","updated_at":"2025-04-15T02:37:25.012Z","avatar_url":"https://github.com/msfidelis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rsmq-promise - Promise interface for RSMQ \n\n[![npm version](https://badge.fury.io/js/rsmq-promise.svg)](https://badge.fury.io/js/rsmq-promise)\n\nA lightweight message queue for Node.js that requires no dedicated queue server. Just a Redis server.\n\n![RSMQ: Redis Simple Message Queue for Node.js](https://img.webmart.de/rsmq_wide.png)\n\n## Usage\n\n* After creating a queue you can send messages to that queue.\n* The messages will be handled in a **FIFO** (first in first out) manner unless specified with a delay.\n* Every message has a unique `id` that you can use to delete the message. \n* The `sendMessage` method will return the `id` for a sent message.\n* The `receiveMessage` method will return an `id` along with the message and some stats.\n* Should you not delete the message it will be eligible to be received again after the visibility timeout is reached.\n* Please have a look at the `createQueue` and `receiveMessage` methods described below for optional parameters like **visibility timeout** and **delay**.\n\n## Install\n\n```bash\nnpm install --save rsmq-promise\n```\n\n## Quickstart\n\n```javascript\nconst RSMQPromise = require('rsmq-promise');\n\nconst rsmq = new RSMQPromise({\n    host: \"127.0.0.1\", \n    port: 6379\n});\n```\n\nParameters for RedisSMQ via an *options* object:\n\n* `host` (String): *optional (Default: \"127.0.0.1\")* The Redis server\n* `port` (Number): *optional (Default: 6379)* The Redis port\n* `options` (Object): *optional (Default: {})* The [Redis options](https://github.com/NodeRedis/node_redis#options-object-properties) object. \n* `client` (RedisClient): *optional* A existing redis client instance. `host` and `server` will be ignored.\n* `ns` (String): *optional (Default: \"rsmq\")* The namespace prefix used for all keys created by RSMQ\n* `realtime` (Boolean): *optional (Default: false)* Enable realtime PUBLISH of new messages (see the [Realtime section](#realtime))\n\n## Create a Queue\n\n```javascript\nrsmq.createQueue({qname: 'myqueue'})\n    .then(done =\u003e console.log('Queue created!'))\n    .catch(err =\u003e console.log(err));\n```\n\n## Send Messages\n\n```javascript\nrsmq.sendMessage({ qname: 'myqueue', message: 'my message!' })\n    .then(result =\u003e console.log(\"Message sent. ID:\", result))\n    .catch(err =\u003e console.log(err));\n```\n\n## Receive a message\n\n```javascript\nrsmq.receiveMessage({qname: 'myqueue'})\n    .then(message =\u003e console.log(message))\n    .catch(err =\u003e console.log(err))\n```\n\n## Delete a message\n\n```javascript\nrsmq.deleteMessage({ qname: 'myqueue', id: 'dhoiwpiirm15ce77305a5c3a3b0f230c6e20f09b55'})\n    .then(result =\u003e console.log(\"Message deleted.\"))\n    .catch(err =\u003e console.log(\"Message not found.\"));\n```\n\n## List Queues\n\n```javascript\nrsmq.listQueues()\n    .then(queues =\u003e console.log(queues))\n    .catch(err =\u003e console.log(err));\n```\n\n## Quit Connection\n\n```javascript\nrsmq.quit()\n    .then(success =\u003e console.log(success))\n    .catch(err =\u003e console.log(err));\n```\n\n\nThanks for: [Patrick Liess](https://github.com/smrchy)\n\nMore info: https://github.com/smrchy/rsmq\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsfidelis%2Frsmq-promise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsfidelis%2Frsmq-promise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsfidelis%2Frsmq-promise/lists"}