npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-jsonrpc-dubbo

v1.0.0

Published

node -> jsonrpc -> dubbo

Downloads

3

Readme

node-jsonrpc-dubbo

终于在祖鹏和文武的努力下,我们的dubbo可以暴露jsonrpc协议了。

这对于我们web端的小伙伴来说,真是喜大普奔的事情。必须鼎力支持。

从此开启web端快速进化之旅,无论是当红炸子鸡nodejs,还是沉稳健壮大python,亦或者Golang,从此八仙过海, 各显神通。

当然我们现在要先解决nodejs的问题。

TODO List

  1. node可以连接zookkeeper,根据/dubbo的path,获取所有的provider,然后进入provider,获取真正的提供者url eg. path=/dubbo/com.ofpay.demo.api.UserProvider/providers,

  2. 根据提供者的信息,过滤出jsonrpc://协议的provider,解析url,获取host:port/path method param

  3. 通过jsonrpc去调用method

  4. 获取注册中心的信息,然后本地缓存配置信息,然后订阅zk的更新,如果有更新重新生成缓存文件

  5. 一个服务可能有多个提供者(集群),现在先随机调度到其中一个。

To be continue

  1. 按需缓存provider的元数据,而不是一下子全sync到client端

  2. provider的调用支持version, group

  3. 接收zookeeper的更新通知,刷新本地provider缓存

  4. 写入consumer信息

usage

更符合node的使用方式和思维习惯


var client = require('./dubbo-client');


var provider = 'com.ofpay.demo.api.UserProvider';

//简单的调用一个接口
client.getProvider(provider, function(err, userProvider) {
  err
    ? console.log(err)
    : userProvider.queryAll(function(err, data) {console.log(err, data);});
});


//group version support
client.getProvider(provider, 'test1', '2.1', function (err, userProvider) {
  err
    ? console.log(err)
    : userProvider.queryAll(function(err, data) {console.log(err, data);});
});