Closed mayurgujrathi closed 5 years ago
I think you are having problem with networking stuff here.
To be able to connect to your redis server from both sides (AWS and IBM) you need some kind of shared PRIVATE Network between AWS and IBM. Then the redis instance can be accessed by both sides and you can run RSMQ to exchange messages.
I Just tried follwing code to create a simple queue. Still not getting any error message or queue created message response. Dont know what went wrong on AWS config.
const RedisSMQ = require("rsmq"); const rsmq = new RedisSMQ({ host: "xxxxxx-001.xxxxxx.0001.aps1.cache.amazonaws.com", port: 6379, ns: "rsmq" ,realtime :true});
rsmq.createQueue({ qname: "myqueue" }, function (err, resp) { console.log('err ',err); console.log('resp ',resp);
if (err) {
console.error(err)
return
}
if (resp === 1) {
console.log("queue created")
}
});
As I already said: I think that this IS NOT A PROBLEM OF RSMQ, BUT ON THE NETWORKING SIDE.
Before this code works on both sides, it does not make sense to try to make RSMQ run:
const redis = require("redis");
const client = redis.createClient({
host: "<YOUR REDIS AWS HOST HERE>",
port: 6379,
});
client.on("error", (err) => {
console.log("Error " + err);
});
client.on("ready", () => {
console.log("Connection established! If this is not logged, we have problems reaching the redis instance. Maybe inspect firewall settings, VPN connection etc...");
});
yeah.. where should I check for Firewall settings and VPN connections. is it on AWS or on my local machine. Not sure what im missing. correct me if im wrong.
You have to ensure that the redis instance on aws is reachable by your hosts, that are not running in AWS.
I think AWS has so called "Security Groups" where you can manage who and what is allowed to access a set of services or machines.
BUT: Redis should not be left open for everyone to access! This would be considered as a security vulnerability because now everyone, who knows your redis server, can read and write data on the server. That's why I mentioned stuff like VPN, which you would need to couple your AWS, AZURE and potentially home networks. But again, this setup seems a bit overblown for a simple message queue.
I'd recommend 2 options:
EDIT: typo
How to get configuration details like host, port, key, etc of RSMQ on IBM cloud.
Created one on AWS https://xxxxxxxxxxxx.amazonaws.com/xxxxxxxxxxx/Test.fifo But not able to connect it.
const RedisSMQ = require("rsmq"); const rsmq = new RedisSMQ( {host: "https://xxxxxxxxxxxx.amazonaws.com/xxxxxxxxxxx/Test.fifo", port: 6379, ns: "rsmq"} );