Skip to content

Instantly share code, notes, and snippets.

View kianenigma's full-sized avatar

Kian Paimani kianenigma

View GitHub Profile
// worker.js log
[2017-4-2 16:33:6][[email protected]:6000] info :: JOIN PING ACCEPTED. response : {"services":{"":{}},"nodes":["127.0.0.1:5000"],"transportServers":{"5000":["CALL","PING"]}}
[2017-4-2 16:33:6][[email protected]:6000] info :: A new node {127.0.0.1:5000} added to systemConf
[2017-4-2 16:33:6][[email protected]:6000] info :: SR :: System Configuration changed new values: {"nodes":["127.0.0.1:6000","127.0.0.1:5000"]}
// client.js log
[2017-4-2 16:33:6][[email protected]:5000] info :: A new node {127.0.0.1:6000} added to systemConf
[2017-4-2 16:33:6][[email protected]:5000] info :: SR :: System Configuration changed new values: {"nodes":["127.0.0.1:5000","127.0.0.1:6000"]}
$ node client.js
const XYZ = require('xyz-core')
const fs = require('fs')
// create a new microservice
let worker = new XYZ({
selfConf: {
name: 'worker.ms',
// rename this if you want to deploy on a VPS
host: '127.0.0.1',
const XYZ = require('xyz-core')
let ms = new XYZ({
selfConf: {
name: 'client.ms',
transport: [{type: 'HTTP', port: 5000}],
host: '127.0.0.1'
}
node worker.js