Commit c9c4e56660aee0025813e1a688dcc937bd99a692
0 parents
Exists in
master
clone dari aaa
Showing 5 changed files with 44 additions and 0 deletions Inline Diff
.gitignore
File was created | 1 | config.ini | |
2 | node_modules/ | ||
3 |
README
File was created | 1 | Monitor AAA PULL via redis pubsub | |
2 |
config.sample.ini
File was created | 1 | [globals] | |
2 | redis_host=localhost | ||
3 | redis_port=6379 | ||
4 |
index.js
File was created | 1 | var iniparser = require('iniparser'); | |
2 | var config = iniparser.parseSync('./config.ini'); | ||
3 | |||
4 | var redis = require('redis'); | ||
5 | |||
6 | redisClient = redis.createClient(config.globals.redis_port, config.globals.redis_host); | ||
7 | |||
8 | redisClient.on("pmessage", function (pattern, channel, message) { | ||
9 | var gateway = channel.match(/gw:(.*)\.text/)[1]; | ||
10 | console.log(message + ' (' + gateway + ')'); | ||
11 | }); | ||
12 | |||
13 | redisClient.psubscribe('kimochi.*.text'); | ||
14 |
package.json
File was created | 1 | { | |
2 | "name": "r97-topup-message-monitor", | ||
3 | "version": "0.0.1", | ||
4 | "description": "Monitor TOPUP MESSAGE via Redis PUBSUB", | ||
5 | "main": "index.js", | ||
6 | "scripts": { | ||
7 | "test": "echo \"Error: no test specified\" && exit 1" | ||
8 | }, | ||
9 | "repository": { | ||
10 | "type": "git", | ||
11 | "url": "git@gitlab.kodesumber.com:reload97/r97-topup-message-monitor.git" | ||
12 | }, | ||
13 | "keywords": [ | ||
14 | "sate24", | ||
15 | "reload97", | ||
16 | "r97", | ||
17 | "st24" | ||
18 | ], | ||
19 | "author": "Adhidarma Hadiwinoto <adhisimon@gmail.com>", | ||
20 | "license": "BSD", | ||
21 | "dependencies": { | ||
22 | "redis": "~0.12.1", | ||
23 | "iniparser": "~1.0.5" | ||
24 | } | ||
25 | } | ||
26 |