Installations
npm install js-remoting-for-apache-dubbo
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>= 8.0.0
Node Version
8.4.0
NPM Version
6.9.0
Score
73.3
Supply Chain
97.2
Quality
73
Maintenance
100
Vulnerability
99.6
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
dubbo
Download Statistics
Total Downloads
9,475
Last Day
6
Last Week
43
Last Month
279
Last Year
2,951
GitHub Statistics
22 Stars
24 Commits
2 Forks
26 Watching
2 Branches
12 Contributors
Bundle Size
110.13 kB
Minified
31.09 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.0
Package Id
js-remoting-for-apache-dubbo@1.0.0
Unpacked Size
110.06 kB
Size
21.02 kB
File Count
38
NPM Version
6.9.0
Node Version
8.4.0
Total Downloads
Cumulative downloads
Total Downloads
9,475
Last day
-25%
6
Compared to previous day
Last week
-28.3%
43
Compared to previous week
Last month
0.7%
279
Compared to previous month
Last year
35%
2,951
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
js-remoting-for-apache-dubbo
dubbo remoting
Introduction
Dubbo Protocol Nodejs Implement
- Common Exchange Packet
0 1 2 4 6 8 10 12
+------+------+------+------+------+------+------+------+------+------+------+------+
| MAGIC | flag |status| packet id |
+-------------+-------------+-------------+-------------+-------------+-------------+
| body length | body |
+---------------------------+ +
| ... ... |
+-----------------------------------------------------------------------------------+
- Dubbo Request Packet
0 1 2 4 6 8 10 12
+------+------+------+------+------+------+------+------+------+------+------+------+
| MAGIC | flag | | packet id |
+-------------+-------------+-----------------+-------------------+-----------------+
| body length | dubbo version | service path | service version |
+---------------+-----------+-----------+-----+-------------------+-----------------+
| method name | arguments description | |
+---------------+-----------------------+ arguments +
| ... ... |
+-----------------------------------------------------------------------------------+
| attachments |
+-----------------------------------------------------------------------------------+
- Dubbo Response Packet
packet status ok
0 1 2 4 6 8 10 12
+------+------+------+------+------+------+------+------+------+------+------+------+
| MAGIC | flag |status| packet id |
+-------------+-------------+---------------------------+---------------------------+
| body length | result flag | |
+---------------------------+---------------------------+ +
| result or exception ... |
+-----------------------------------------------------------------------------------+
packet status not ok
0 1 2 4 6 8 10 12
+------+------+------+------+------+------+------+------+------+------+------+------+
| MAGIC | flag |status| packet id |
+-------------+-------------+---------------------------+---------------------------+
| body length | error message |
+---------------------------+-------------------------------------------------------+
Install
1$ npm install dubbo-remoting --save
Usage
You can use this dubbo protocol implementation with the sofa-rpc-node
1. Install & Launch zk
1$ brew install zookeeper 2 3$ zkServer start 4ZooKeeper JMX enabled by default 5Using config: /usr/local/etc/zookeeper/zoo.cfg 6Starting zookeeper ... STARTED
2. Expose a dubbo service
1'use strict'; 2 3const { RpcServer } = require('sofa-rpc-node').server; 4const { ZookeeperRegistry } = require('sofa-rpc-node').registry; 5const protocol = require('dubbo-remoting'); 6 7const logger = console; 8 9// 1. create zk registry client 10const registry = new ZookeeperRegistry({ 11 logger, 12 address: '127.0.0.1:2181', 13}); 14 15// 2. create rpc server 16const server = new RpcServer({ 17 logger, 18 registry, 19 port: 12200, 20 protocol, 21}); 22 23// 3. add service 24server.addService({ 25 interfaceName: 'com.nodejs.test.TestService', 26}, { 27 async plus(a, b) { 28 return a + b; 29 }, 30}); 31 32// 4. launch the server 33server.start() 34 .then(() => { 35 server.publish(); 36 });
3. Call the dubbo service
1'use strict'; 2 3const { RpcClient } = require('sofa-rpc-node').client; 4const { ZookeeperRegistry } = require('sofa-rpc-node').registry; 5const protocol = require('dubbo-remoting'); 6const logger = console; 7 8// 1. create zk registry client 9const registry = new ZookeeperRegistry({ 10 logger, 11 address: '127.0.0.1:2181', 12}); 13 14async function invoke() { 15 // 2. create rpc client with dubbo protocol 16 const client = new RpcClient({ 17 logger, 18 registry, 19 protocol, 20 }); 21 // 3. create rpc service consumer 22 const consumer = client.createConsumer({ 23 interfaceName: 'com.nodejs.test.TestService', 24 }); 25 // 4. wait consumer ready 26 await consumer.ready(); 27 28 // 5. call the service 29 const result = await consumer.invoke('plus', [1, 2], { responseTimeout: 3000 }); 30 console.log('1 + 2 = ' + result); 31} 32 33invoke().catch(console.error);
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0
Reason
Found 1/17 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 14 are checked with a SAST tool
Score
3
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More