rsmq icon indicating copy to clipboard operation
rsmq copied to clipboard

Unable to connect with redis-clustr

Open captmiddy opened this issue 4 years ago • 2 comments

I am attempting to connect to AWS Redis Cluster, and it simply doesn't seem to work. On fullReady I am able to get the message that the queue is being created, but as soon as I attempt to create the new rsmq, it hangs and doesn't go to the next console message. Sometimes I will get a stack too deep message. If I put a get into the section before the first console.log, I will get the result, but the queue never seems to continue. Changing this to use the internal client fails due to the cluster on the backend, but does get passed the lock. Is the redis-clustr client not supported?

const RedisSMQ = require("rsmq");
require('dotenv').config();

const RedisClustr = require('redis-clustr');
const RedisClient = require('redis');

var redis = new RedisClustr({
    servers: [
        {
            host: process.env.REDIS_HOST,
            port: process.env.REDIS_PORT
        }
    ],
    createClient: function(port, host) {
    // this is the default behaviour
        return RedisClient.createClient(port, host);
    }
});

redis.on('fullReady', () => { 
    console.log("Creating Queue");
    const rsmq = new RedisSMQ({ client: redis, ns: 'rsmq'});
    console.log("Client Established");
    rsmq.createQueue({ qname: 'TestingQueue'}, (err) => {
        if(err) console.err(err);
        else console.log("Queue Established");
    })
});

captmiddy avatar May 30 '20 16:05 captmiddy

Sorry for the late reply. I did not test Redis Cluster, yet. Did anybody get RSMQ with Redis Cluster to work? The main LUA script running could be a problem.

smrchy avatar Jan 26 '21 12:01 smrchy

I'm also interested in this question because we'd like to switch to Redis Cluster

0x8f701 avatar Feb 04 '21 00:02 0x8f701