{"id":46814,"library":"wm-redis-message","title":"Redis-based Message Queue Library","description":"wm-redis-message v1.1.4 is a lightweight, Redis-backed message queue implementation for Node.js, providing features like topic-based message fetching, automatic retry with configurable max retries (default 5), lock-based concurrency control, and custom fetch/after-fetch/failure handlers. It uses a poll-and-ack pattern with configurable batch sizes (default 200) and acknowledgment timeout (default 60s). Released on npm, it targets simple queue needs without external dependencies. Differentiators: minimal API, pre-built retry and lock mechanisms, and flexible callback structure for message lifecycle. Current stable version 1.1.4 has infrequent releases; no breaking changes reported.","status":"active","version":"1.1.4","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/mapleincode/redis-message","tags":["javascript"],"install":[{"cmd":"npm install wm-redis-message","lang":"bash","label":"npm"},{"cmd":"yarn add wm-redis-message","lang":"bash","label":"yarn"},{"cmd":"pnpm add wm-redis-message","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Requires destructuring from CommonJS; named export, not default.","wrong":"const RedisMessage = require('wm-redis-message');","symbol":"RedisMessage","correct":"const { RedisMessage } = require('wm-redis-message');"},{"note":"ESM import also requires named import; no default export.","wrong":"import RedisMessage from 'wm-redis-message';","symbol":"RedisMessage","correct":"import { RedisMessage } from 'wm-redis-message';"}],"quickstart":{"code":"const { RedisMessage } = require('wm-redis-message');\n\nconst options = {\n  topic: 'my-topic',\n  messageType: 'my-type',\n  redis: { host: 'localhost', port: 6379 },\n  fetchMessage: null, // uses default\n  afterFetchMessage: null,\n  dealfailedMessage: null,\n  maxAckTimeout: 60000,\n  eachMessageCount: 200,\n  minRedisMessageCount: 200,\n  maxRetryTimes: 5,\n  lockExpireTime: 60\n};\n\n(async () => {\n  const cache = new RedisMessage(options);\n  const messages = await cache.getMessages(10);\n  console.log('Fetched messages:', messages);\n})();","lang":"javascript","description":"Initializes RedisMessage with options and fetches up to 10 messages from the queue."},"warnings":[{"fix":"Use destructured import: const { RedisMessage } = require('wm-redis-message');","message":"Using incorrect import (default import or wrong path) leads to 'RedisMessage is not a constructor' TypeError.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Include a `redis` property in options object with host and port (or any ioredis-compatible config).","message":"Redis connection object must be provided; if missing, constructor throws.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always treat return value as array; check length before accessing elements.","message":"The `getMessages` method returns an array, but if no messages available, returns empty array (not null).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Create custom .d.ts or use @types/wm-redis-message if available.","message":"No TypeScript types provided; using with TypeScript requires manual type definitions.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.1.4':98 '200':61 '5':38 '60s':66 'ack':54 'acknowledg':63 'api':80 'automat':31 'back':17 'base':3,28,41 'batch':58 'break':103 'built':83 'callback':90 'chang':104 'concurr':42 'configur':34,57 'control':43 'current':95 'custom':45 'default':37,60,65 'depend':77 'differenti':78 'extern':76 'featur':24 'fetch':30 'fetch/after-fetch/failure':46 'flexibl':89 'handler':47 'implement':20 'infrequ':100 'javascript':106 'librari':6 'lifecycl':94 'lightweight':14 'like':25 'lock':40,86 'lock-bas':39 'max':35 'mechan':87 'messag':4,10,18,29,93 'minim':79 'need':74 'node.js':22 'npm':69 'pattern':55 'poll':52 'poll-and-ack':51 'pre':82 'pre-built':81 'provid':23 'queue':5,19,73 'redi':2,9,16 'redis-back':15 'redis-bas':1 'releas':67,101 'report':105 'retri':32,36,84 'simpl':72 'size':59 'stabl':96 'structur':91 'target':71 'timeout':64 'topic':27 'topic-bas':26 'use':49 'v1.1.4':11 'version':97 'without':75 'wm':8 'wm-redis-messag':7","created_at":"2026-06-07T13:01:45.879111+00:00","updated_at":"2026-06-07T13:01:45.879111+00:00","problems":[{"fix":"const { RedisMessage } = require('wm-redis-message');","cause":"Using default import or wrong destructuring.","error":"TypeError: RedisMessage is not a constructor"},{"fix":"Provide a function that returns a Promise resolving to an array, or omit to use default.","cause":"Override fetchMessage with non-function value.","error":"Error: fetchMessage must be a function"},{"fix":"Pass a valid redis object (e.g., { host: 'localhost', port: 6379 }).","cause":"Redis config missing or invalid.","error":"TypeError: Cannot read property 'host' of undefined"}],"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/mapleincode/redis-message#readme","github":"ssh://git@github.com/mapleincode/redis-message","docs":null,"changelog":null,"pypi":null,"npm":"wm-redis-message","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}}