/zoodubbo

A nodejs lib to connect dubbo service by zookeeper client.

Primary LanguageJavaScriptMIT LicenseMIT

zoodubbo

Build Status Coveralls NPM Version NPM Downloads GitHub stars

A Javascript module for Node.js to connect Dubbo service by node-zookeeper-client.

Installation

You can install it using npm:

$ npm install zoodubbo

Example

var ZD = require('zoodubbo');

var zd = new ZD({
    conn: 'localhost:2181',
    dobbo: '2.5.3'
});

zd.connect();

zd.client.on('connected', function connect() {
    console.log('zookeeper client connected!');
});

var service = zd.getService('com.demo.Service');

var method = 'getUserByID';
var arg1={$class:'int',$:123};

service.excute(method, [arg1], function (err, data) {
    console.log('excute');
    if (err) {
        console.log(err);
        return;
    }
    console.log(data)
});