Why NodeJS not receiving REDIS messages!

Hi all,
Based on some reading like How to get Realtime Updates in your App from ERPNext via Socket.io and Redis | by Parth Joshi | Medium and
Node.js Notifications from client to server and
How to verify that 'frappe.publish_realtime()' has actually published something? i was trying to have my NODEJS app to send and receive messages …

Created the Nodejs.js like
var redis = require(“redis”);
var { get_conf, get_redis_subscriber } = require(path.resolve(‘./apps/frappe/node_utils’))

var conf = get_conf();

//var subscriber = redis.createClient(conf.redis_socketio || conf.redis_async_broker_port);
var subscriber = get_redis_subscriber();



subscriber.on(“message”, function (channel, message) {
message = JSON.parse(message);
console.log('message ',message);
if (message.event == “custom_connector”) {
console.log(“FRAPPE Got the Message:”, message);
console.log(“FRAPPE Got the Message:”, message);

Now on a bench console i send:
frappe.publish_realtime(event=‘custom_connector’,message=‘TESTES’) does not get to the NODEJS

frappe.publish_realtime(event=‘msgprint’,message=‘TESTES’) Works fine.

Any reason why REDIS (publish.realtime) not being received by the Nodejs server?

Thank you :slight_smile:

1 Like