Skip to content

m-allanson/bullmq-redis-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Debugging redis connection errors with BullMQ. I was getting:

[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)

Note that the port 6379 is not the port provided in REDIS_URL.

This is because the QueueEvents constructor requires connection options. This seems obvious in retrospect, but it's not mentioned in the docs.

The API docs mention that option, but it's tucked away in QueueEvents.(constructor) --> QueueEventsOptions interface --> QueueBaseOptions interface

Requirements

  • A local redis server running on a non-standard port. 5555 is used in this demo.
  • Node.js v14+ (for esm support)

Getting started

  • npm install
  • npm run start

Output

❯ npm run start

> bull-redis@1.0.0 start /Users/mike/d/temp/bull-redis
> REDIS_URL=redis://127.0.0.1:5555 node index.js

redis is:  ready

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published