{"id":46284,"library":"rsmq","title":"RSMQ (Redis Simple Message Queue)","description":"RSMQ is a lightweight FIFO message queue for Node.js that requires only a Redis server (no dedicated queue server). Version 0.12.4 (stable) runs on Node >=6 and Redis >=2.6 (due to Lua scripts). It guarantees message delivery to exactly one consumer within a configurable visibility timeout. The core library is ~500 lines of JavaScript and ships TypeScript type definitions. Optional promise-based API via *Async method suffixes. Key differentiator vs Bull or Kue: no dependencies beyond Redis, minimal API surface, and very high throughput (10k+ messages/sec). Releases are infrequent; maintained by smrchy.","status":"active","version":"0.12.4","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/smrchy/rsmq","tags":["javascript","queue","messagequeue","jobs","message-queue","redis","typescript"],"install":[{"cmd":"npm install rsmq","lang":"bash","label":"npm"},{"cmd":"yarn add rsmq","lang":"bash","label":"yarn"},{"cmd":"pnpm add rsmq","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"RSMQ wraps the node_redis client for all Redis operations","package":"redis","optional":false}],"imports":[{"note":"ESM default import (CJS works but is not recommended). The library ships TypeScript types.","wrong":"const RedisSMQ = require('rsmq')","symbol":"RedisSMQ","correct":"import RedisSMQ from 'rsmq'"},{"note":"CommonJS require for older Node versions; named import is incorrect.","wrong":"import { RedisSMQ } from 'rsmq'","symbol":"RedisSMQ","correct":"const RedisSMQ = require('rsmq')"},{"note":"Constructor option is `ns`, not `namespace`. See docs.","wrong":"const queue = new RedisSMQ({ namespace: 'rsmq' })","symbol":"QueueInstance","correct":"const queue = new RedisSMQ({ host: '127.0.0.1', port: 6379, ns: 'rsmq' })"}],"quickstart":{"code":"import RedisSMQ from 'rsmq';\nimport redis from 'redis';\n\nconst client = redis.createClient();\nconst queue = new RedisSMQ({ client, ns: 'test' });\n\n// Create queue\nqueue.createQueue({ qname: 'myqueue' }, (err, resp) => {\n  if (err) throw err;\n  console.log('Queue created:', resp);\n});\n\n// Send a message\nqueue.sendMessage({ qname: 'myqueue', message: 'Hello RSMQ!' }, (err, msgId) => {\n  if (err) throw err;\n  console.log('Message sent, id:', msgId);\n});\n\n// Receive a message\nqueue.receiveMessage({ qname: 'myqueue' }, (err, msg) => {\n  if (err) throw err;\n  if (msg) {\n    console.log('Received:', msg.message);\n    // Delete after processing\n    queue.deleteMessage({ qname: 'myqueue', id: msg.id }, (err) => {\n      if (err) throw err;\n      console.log('Deleted');\n    });\n  }\n});\n\nqueue.quit();\nclient.quit();","lang":"typescript","description":"This shows how to instantiate RSMQ, create a queue, send a message, receive it, and delete it using callback-based API."},"warnings":[{"fix":"Replace `redisClient` with `client` in constructor options.","message":"Constructor options changed between 0.11.x and 0.12.x: `redisClient` renamed to `client`.","severity":"breaking","affected_versions":">=0.12.0"},{"fix":"Use `Async`-suffixed methods and `await` with try/catch instead of callbacks.","message":"The callback pattern is deprecated in favor of async methods suffix (e.g., `receiveMessage` vs `receiveMessageAsync`).","severity":"deprecated","affected_versions":">=0.9.0"},{"fix":"Check queue existence first with `getQueueAttributes` if you don't want to overwrite parameters.","message":"Queue creation with `createQueue` is synchronous and will overwrite existing queue parameters if not careful.","severity":"gotcha","affected_versions":"*"},{"fix":"Upgrade Redis to at least 2.6, preferably 3.x or later.","message":"Redis 2.6+ is required; using older Redis will cause cryptic Lua script errors (e.g., 'ERR Error running script...').","severity":"gotcha","affected_versions":"*"},{"fix":"Create your own Redis client and pass it via `client` option.","message":"The `host` + `port` constructor parameters are deprecated in favor of passing a `client` instance.","severity":"deprecated","affected_versions":">=0.11.0"}],"env_vars":null,"search_vec":"'0.12.4':26 '10k':91 '2.6':34 '500':56 '6':31 'api':69,85 'async':71 'base':68 'beyond':82 'bull':77 'configur':49 'consum':46 'core':53 'dedic':22 'definit':64 'deliveri':42 'depend':81 'differenti':75 'due':35 'exact':44 'fifo':10 'guarante':40 'high':89 'infrequ':95 'javascript':59,99 'job':102 'key':74 'kue':79 'librari':54 'lightweight':9 'line':57 'lua':37 'maintain':96 'messag':4,11,41,104 'message-queu':103 'messagequeu':101 'messages/sec':92 'method':72 'minim':84 'node':30 'node.js':14 'one':45 'option':65 'promis':67 'promise-bas':66 'queue':5,12,23,100,105 'redi':2,19,33,83,106 'releas':93 'requir':16 'rsmq':1,6 'run':28 'script':38 'server':20,24 'ship':61 'simpl':3 'smrchi':98 'stabl':27 'suffix':73 'surfac':86 'throughput':90 'timeout':51 'type':63 'typescript':62,107 'version':25 'via':70 'visibl':50 'vs':76 'within':47","created_at":"2026-06-07T12:59:10.068136+00:00","updated_at":"2026-06-07T12:59:10.068136+00:00","problems":[{"fix":"Use `import RedisSMQ from 'rsmq'` (default import).","cause":"Using named import `import { RedisSMQ } from 'rsmq'` instead of default import.","error":"TypeError: RedisSMQ is not a constructor"},{"fix":"Start Redis server or check `host`/`port` configuration.","cause":"No Redis server running at the configured host/port.","error":"Error: Redis connection refused"},{"fix":"Ensure all method parameters are strings or numbers; convert objects with JSON.stringify.","cause":"Passing non-string/non-integer values to RSMQ methods (e.g., number message).","error":"Error: ERR Error running script (call to f_...): @user_script:1: Lua redis lib command args must be strings or integers"},{"fix":"Create queue first with `createQueue` or use `listQueues` to check available queues.","cause":"Trying to send/receive from a queue that doesn't exist.","error":"Error: Queue <name> not found"}],"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/smrchy/rsmq#readme","github":"ssh://git@github.com/smrchy/rsmq","docs":null,"changelog":null,"pypi":null,"npm":"rsmq","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}}