Node.js native Apache Dubbo client on hessian

Clone this repo:
  1. 28e499b Merge pull request #253 from KenyeeC/fix/stringify_dubboServiceUrl by 胡锋 · 3 weeks ago master
  2. cb38b86 fix: exchange the wrong order of version and group by zhangjianye1 · 3 weeks ago
  3. b089202 fixed: use unlinkSync replace rmSync by hufeng · 5 weeks ago
  4. 9a40fd5 fixed: use .dubbo as lock file and Remove the dependency on the nodejs master process environment by hufeng · 6 weeks ago
  5. e84b9c6 fixed: prepare release and fixed license and notice end year by hufeng · 6 weeks ago

Apache Dubbo-js

Dubbo-js, using Node.js to embrace the Dubbo ecosystem. See this Demo to find how intelligent this project is.

Node.js CI


  • Various transport protocols (Hessian, JSON-RPC etc.) supports
  • Tracing (Runtime information, Call Stack)
  • Multiple registry centers (Zookeeper, Nacos, Redis) supports or connecting to services directly
  • Extensibility, inspired from Koa Middleware
  • Builtin reconnection strategy
  • Typescript type definitions
  • Tools to automatically translate Java interfaces to Typescript type definitions
  • Dubbox supports


Getting Started

yarn add apache-dubbo-js


Below code snippet shows how to work with the typescript type definitions which automatically translated from Java interfaces.

// ===================== service.ts ==================
// generated by interpret tools
import { BasicTypeProvider } from './providers/org/apache/dubbo/demo/BasicTypeProvider'
import { DemoProvider } from './providers/org/apache/dubbo/demo/DemoProvider'
import { ErrorProvider } from './providers/org/apache/dubbo/demo/ErrorProvider'

export default {

// =============== dubbo.ts ========================
import { Dubbo } from 'apache-dubbo-js'
import service from './service'

// create dubbo object
const dubbo = new Dubbo<typeof service>({
  application: { name: 'dubbo-js' },
  // zookeeper address
  register: 'localhost:2181',

// main method
;(async () => {
  let { res, err } = await dubbo.service.DemoProvider.sayHello('node')
  // print {err: null, res:'hello node from dubbo service'}
  ;({ res, err } = await dubbo.service.DemoProvider.echo())
  // print {err: null, res: 'pang'}
  ;({ res, err } = await dubbo.service.DemoProvider.getUserInfo())
  // print {status: 'ok', info: { id: '1', name: 'test' }, err: null}

The automatically translated typescript type definitions are not necessary, below code snippet demonstrates how to use dubbo-js without them.

// create the service to be injected
import { Dubbo } from 'apache-dubbo-js'

const demoProvider = (dubbo) =>
    dubboInterface: 'org.apache.dubbo.demo.DemoProvider',
    version: '1.0.0',
    methods: {
      sayHello(name) {
        return [java.String(name)]

      echo() {},

      test() {},

      getUserInfo() {
        return [
          java.combine('org.apache.dubbo.demo.UserRequest', {
            id: 1,
            name: 'nodejs',
            email: ''

// integrate the service in demoProvider with dubbo object constructor
const service = {

const dubbo = new Dubbo<typeof service>({
  // ....other parameters

How to run a quick starter?

Make sure java, maven, docker, Node, Yarn is installed locally. If you‘d like to contribute, it’s a good start to follow below commands to get a locally runnable project.

# cd root dir
cd dubbo-js

# start java dubbo service
chmod 755 ./
sh ./

# build package module

# start node
cd example/hello-koa
# install node modules
# start web
yarn run debug:start
# test /hello
curl http://localhost:3000/hello

# or hello-egg example
cd example/hello-egg
yarn run dev
# test /hello

How to run all tests

cd dubbo-js
sh ./
yarn run test

How to build dubbo-js module

git clone
cd dubbo-js
npm install -g lerna
lerna bootstrap
make build-dubbo

Next steps


Reporting bugs

Please follow the template for reporting any issues.

Knowledge Sharing

2019-meetup by hufeng


Dubbo-js will not work without:

Many thanks to their authors fengmk2 and dead-horse.

contact us


Apache Dubbo is under the Apache 2.0 license. See the LICENSE file for details.