rsmq
rsmq copied to clipboard
Unable to connect with redis-clustr
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");
})
});
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.
I'm also interested in this question because we'd like to switch to Redis Cluster