Bull: Create queue with redis URL fails

Created on 26 Jul 2016  路  4Comments  路  Source: OptimalBits/bull

According to the documentation, creating a queue with a single connection string should work:
Queue(queueName, redisConnectionString, [redisOpts]).

Where: redisConnectionString {String} A connection string containing the redis server host, port and (optional) authentication.

However, when I do something like this, I get the error below:
var emailQueue = Queue('email-queue', 'redis://localhost:6379')

TypeError: Cannot create property 'host' on string '127.0.0.1' at createClient (.../node_modules/redis/lib/createClient.js:40:30) at Object.exports.createClient (.../node_modules/redis/index.js:1081:41) at createClient (.../node_modules/bull/lib/queue.js:72:22) at new Queue (.../node_modules/bull/lib/queue.js:88:17) at Queue (.../node_modules/bull/lib/queue.js:52:12) ...

Looking at the code in queue.js, there is nowhere where the second parameter gets treated as a URL. Not sure if this is just not implemented or the documentation is just incorrect.

bug

Most helpful comment

@innovative1 @kurokochin I found workaround: try passing empty object as the last argument to Queue( call, eg. :

var emailQueue = Queue('email-queue', 'redis://localhost:6379', {})

All 4 comments

@innovative1 confirmed, having the same bug

+1 confirmed, having the same bug too plsss fix it soon as soon as possible plsssssss

@innovative1 @kurokochin I found workaround: try passing empty object as the last argument to Queue( call, eg. :

var emailQueue = Queue('email-queue', 'redis://localhost:6379', {})

This seems to be fixed, there is a passing unit test for it: https://github.com/OptimalBits/bull/blob/master/test/test_queue.js#L153-L169

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sibelius picture sibelius  路  3Comments

NicolasDuran picture NicolasDuran  路  4Comments

pintocarlos picture pintocarlos  路  3Comments

Jujunol picture Jujunol  路  4Comments

pigaov10 picture pigaov10  路  3Comments