I was using redis version 3 in my nodejs app that published a message, to publish this message I was able to fetch specific keys that matched a value. Now I updated to version 4 and it looks like the key fetching part is not working anymore and messages aren’t being published. Here is that piece of code:
async myFunction(someData){
console.log(someData) // this is being logged
this.redisClient.keys('REDIS_SUBSCRIBER_SOCKET_CHANNEL_*', (err, ids) => {
if(err){
return console.log(err) // this is not being logged
}
console.log('ids: ' + ids); // this is not being logged
ids.forEach(id => {
console.log(
'Distributing: ' + JSON.stringify(someData),
);
this.publisherClient.publish(id, JSON.stringify(someData));
});
});
}
I can only think that the keys aren’t being fetched corrrectly, connection is being done succesfully when my app starts.