Giter Site home page Giter Site logo

node-zookeeper-dubbo's Introduction

node-zookeeper-dubbo

nodejs通过dubbo默认协议通信

NPM version

Usage

const nzd=require('node-zookeeper-dubbo');
const app=require('express')();
const opt={
  application:{name:'fxxk'},
  register:'www.cctv.com:2181',
  dubboVer:'2.5.3.6',
  root:'dubbo',
  dependencies:{
    Foo:{interface:'com.service.Foo',version:'LATEST',timeout:6000,group:'isis'},
    Bar:{interface:'com.service.Bar',version:'LATEST',timeout:6000,group:'gcd'}
  }  
}

const Dubbo=new nzd(opt);

const customerObj = {
  $class: 'com.xxx.XXXDTO',
  $: {
    a: 1,
    b: 'test',
    c: {$class: 'java.lang.Long', $: 123}
  }
};

app.get('/foo',(req,res)=>{
  Dubbo.Foo
    .xxMethod({'$class': 'java.lang.Long', '$': '10000000'},customerObj)
    .then(data=>res.send(data))
    .catch(err=>res.send(err))
})

app.listen(9090)

Notice

首先 必须等待初始化完毕才能正常使用 ,标志就是Dubbo service init done

如果要和1.x版本共存的话试试这个,niv.

Config

application

name

项目名

register

zookeeper连接字符串

dubboVer

dubbo版本

root

注册到zk上的根节点,默认为dubbo

dependencies

依赖的服务列表

interface

服务地址,必填

version

版本号,可选,默认2.5.3.6

timeout

超时时间,可选,默认6000

group

分组,可选

you can use js-to-java

var arg1={$class:'int',$:123};
//equivalent
var arg1=java('int',123);

Optimize

有什么建议尽管提,我们会根据实际情况做出改动。

Contributors

PanEW

zhanghua

caomu

zhchj126

node-zookeeper-dubbo's People

Contributors

caomu avatar justinyueh avatar omnip620 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.