node.js - Listen to channel matching the pattern on node redis? -
I am using node-radis
Everything is working only I am subscribing to the specific
channel but I am receiving messages from every channel:
server code:
socket.on ('connection', function (customer) {cons subscribe = redis.createClient (637 9), '127.0.0.1') subscribe.psubscribe ('tracking_ *'); Subscribe.on ("error", function (error) {console.log ("error" + mistake);}); Subscribe.on ("pmessage" (Message, message, "# channel +" received from channel "", "+ Message +;");}); Client.on ('message', function (msg) {log ('debug', msg);}); Client.on ('disconnect', function (log) (log ('warning', 'disconnect from radis'); subscribe.quit ();})
customer code: /> socket.on ('connect', function (data) {setStatus ('connect'); socket.emit ('subscribe', {channel: 'tracking_hi'});}); < / Code>
socket.on ('connect', function (data) {setStatus ('connect'); socket.emit ('subscribe', {channel: 'tracking_hi'});}); < / Code>
As you can see, I'm subscribing to the only subsc Tracking
channel but I am getting the message from all the channels.What's wrong?
Comments
Post a Comment