smrchy / rsmq

Redis Simple Message Queue
MIT License
1.76k stars 125 forks source link

Specify redis db in options #125

Closed HeberLemus closed 3 years ago

HeberLemus commented 4 years ago

cant seem to specify which redis db to use via the options object. am i setting this incorrectly?

what i have as settings: redisMQ: { host: 'hostname', port: port, ns: 'rsmq-development', options: { db: 3 }, }, and feeding that into const rsmq = new RMSQ(settings.redisMQ);

but when i check using Another Redis Desktop Manager, i see everything happening on the default db 0. have i read this incorrectly?

tontonrally commented 4 years ago

As a solution, I think you can create a redis client instance with the db option set to whatever db you need (node-redis lib, with the createClient method) then pass the client to the rsmq constructor via the client option.