Commit c13a5f4673f2fe1ca492c05c60373cb7b3593712
1 parent
d193d8b789
Exists in
master
gateway name on sep
Showing 1 changed file with 1 additions and 1 deletions Inline Diff
index.js
1 | var iniparser = require('iniparser'); | 1 | var iniparser = require('iniparser'); |
2 | var config = iniparser.parseSync('./config.ini'); | 2 | var config = iniparser.parseSync('./config.ini'); |
3 | 3 | ||
4 | var redis = require('redis'); | 4 | var redis = require('redis'); |
5 | 5 | ||
6 | redisClient = redis.createClient(config.globals.redis_port, config.globals.redis_host); | 6 | redisClient = redis.createClient(config.globals.redis_port, config.globals.redis_host); |
7 | 7 | ||
8 | redisClient.on("pmessage", function (pattern, channel, message) { | 8 | redisClient.on("pmessage", function (pattern, channel, message) { |
9 | var gateway = channel.match(/gw:(.*)\.message$/)[1]; | 9 | var gateway = channel.match(/gw:(.*)\.message$/)[1]; |
10 | console.log('----------------'); | 10 | console.log('---------------- ' + gateway + ':'); |
11 | console.log(message + ' (' + gateway + ')'); | 11 | console.log(message + ' (' + gateway + ')'); |
12 | }); | 12 | }); |
13 | 13 | ||
14 | redisClient.psubscribe('echi.topup_report.*.message'); | 14 | redisClient.psubscribe('echi.topup_report.*.message'); |
15 | 15 |