Skip to content
Permalink
Browse files
修改版本号,发布到pip
  • Loading branch information
JoeCao committed Apr 18, 2015
1 parent be04141 commit 4d4498d5da588464eb97321dfeebc9ee2d71474f
Showing 10 changed files with 28 additions and 4 deletions.
@@ -0,0 +1,2 @@
include README.md
include version.txt
@@ -11,10 +11,12 @@ Python Dubbo Client
### 安装
下载代码
python setup.py install
pip安装
pip install dubbo-client==1.0.0b4
Git安装
pip install git+http://git.dev.qianmi.com/tda/dubbo-client-py.git@1.0.0b2
pip install git+http://git.dev.qianmi.com/tda/dubbo-client-py.git@1.0.0b4
或者
pip install git+https://github.com/ofpay/dubbo-client-py.git@1.0.0b2
pip install git+https://github.com/ofpay/dubbo-client-py.git@1.0.0b4

### 在客户端实现负载均衡,服务发现
通过注册中心的zookeeper,获取服务的注册信息
BIN +237 Bytes (100%) dist/dubbo-client-1.0.0b2.tar.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,16 +1,36 @@
from dubbo_client import ZookeeperRegistry, MulticastRegistry
from dubbo_client import ZookeeperRegistry, MulticastRegistry, Registry

__author__ = 'caozupeng'


def multicat():
registry = MulticastRegistry('224.5.6.7:1234')
registry.subscribe('com.ofpay.demo.api.UserProvider')
print registry.get_provides('com.ofpay.demo.api.UserProvider')


def zookeeper():
registry = ZookeeperRegistry('172.19.65.33:2181')
registry.subscribe('com.ofpay.demo.api.UserProvider')
print registry.get_provides('com.ofpay.demo.api.UserProvider')


def test_registry():
registry = Registry()
registry._add_node("com.ofpay.demo.api.UserProvider",
"jsonrpc://192.168.2.1:38081/com.ofpay.demo.api.UserProvider2?"
"anyhost=true&application=jsonrpcdemo&default.timeout=10000&"
"dubbo=2.4.10&environment=product&interface=com.ofpay.demo.api.UserProvider&"
"methods=getUser,queryAll,isLimit,queryUser&owner=wenwu&pid=60402&revision=2.0&"
"side=provider&timestamp=1429105028153&version=2.0")
registry._add_node("com.ofpay.demo.api.UserProvider",
"jsonrpc://192.168.2.1:38081/com.ofpay.demo.api.UserProvider?"
"anyhost=true&application=jsonrpcdemo&default.timeout=10000&"
"dubbo=2.4.10&environment=product&interface=com.ofpay.demo.api.UserProvider&"
"methods=getUser,queryAll,isLimit,queryUser&owner=wenwu&pid=60402&revision=2.0&"
"side=provider&timestamp=1429105028153&version=1.0")
assert registry._service_provides


if __name__ == '__main__':
multicat()
@@ -1 +1 @@
1.0.0b2
1.0.0b4

0 comments on commit 4d4498d

Please sign in to comment.